Solved

Setting default values for JMS Queues in JBoss

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now