Solved

Setting default values for JMS Queues in JBoss

Posted on 2008-06-26
2
726 Views
Last Modified: 2013-12-02
I am using J2EE JMS Queues on JBoss 4.0.3 server. I am trying to figure out how to change the default value for the "timeToLive" parameter from 0 to 60000. I want to change the value so that the messages I place on the queues will expire rather than sit there indefinitely. I found the settings for the DLQ dead letter queue in a file called jbossstandard.xml. Do I need to add my queues to this file in order to set a default timeToLive parameter? I noticed that changing the timetolive param can be accomplised in code (programmatically) but I would like to do this administratively.  Anyone know how to change the timetolive param administratively?
0
Comment
Question by:texastemplar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
MicheleMarcon earned 500 total points
ID: 21881362
From JBoss website:

The methods defined in a Producer are turned into JMS messages. The default message properties are a Time To Live of 0, a Priority of 4, and a delivery mode of PERSISTENT. You can override these default values in a couple of ways.

    * First you can use the @MessageProperties anntotation and tag the Producer class directly to override the values:

@Producer
@MessageProperties(delivery=DeliveryMode.NON_PERSISTENT, timeToLive=1000, priority=1)
public interface QueueTestRemote
{
   public void method1(String msg, int num);
}

In this configuration, all method calls on QueueTestRemote will use the JMS message properties defined with the @MessageProperties annotation on the interface.

    * Second, you can specify @MessageProperties on a per method basis.

@Producer
public interface QueueTestRemote
{
   public void method1(String msg, int num);

   @MessageProperties(delivery=DeliveryMode.NON_PERSISTENT, timeToLive=1000, priority=1)
   public void method2(String msg, int num);
}

So, in the above example, method1() uses the default message properties, and method2() overrides the defaults via the @MessageProperties annotation attached to it.
0
 

Author Comment

by:texastemplar
ID: 21886123
I was hoping to set the default JMS message parameters in a config file. Is there a way to set these values in a config file?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question