Solved

Setting default values for JMS Queues in JBoss

Posted on 2008-06-26
2
723 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
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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping1 challenge 7 110
HTTPSessionBindingListernter not configured in deployment descriptor 2 65
servlet example 17 51
web project error add remove 1 27
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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.

792 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