Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Setting default values for JMS Queues in JBoss

Posted on 2008-06-26
2
Medium Priority
?
728 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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.
Suggested Courses

916 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