Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9072849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:16:15+00:00 2026-06-16T18:16:15+00:00

I am using ActiveMQ 5.7.0 and trying to implement a redelivery policy. I have

  • 0

I am using ActiveMQ 5.7.0 and trying to implement a redelivery policy. I have two queues that I need to set redelivery policies for. However in testing, it does not apply my policy. Instead of following the configuration below, it retries 7 times @ 1sec intervals (not what I specified).

  <!--  ActiveMQ destinations to use  -->
  <amq:queue id="destinationOne" physicalName="${activemq.one.queuename}">
    <amq:properties>
        <amq:redeliveryPolicy destination="One.DLQ" maximumRedeliveries="5" initialRedeliveryDelay="300000" useExponentialBackOff="true" backOffMultiplier="2" maximumRedeliveryDelay="3600000"/>
    </amq:properties>
  </amq:queue>
  <amq:queue id="destinationTwo" physicalName="${activemq.two.queuename}">
    <amq:properties>
        <amq:redeliveryPolicy destination="Two.DLQ" maximumRedeliveries="5" initialRedeliveryDelay="300000" useExponentialBackOff="true" backOffMultiplier="2" maximumRedeliveryDelay="3600000"/>
    </amq:properties>
  </amq:queue>

I have two listeners defined and they are applying the queues as below:

  <bean id="oneMessageListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination" ref="destinationOne"/>
    <property name="messageListener" ref="jmsOneListener" />
    <property name="autoStartup" value="false" />    
    <property name="sessionTransacted" value="true"/>
    <property name="concurrentConsumers" value="2" />
  </bean>
  <bean id="twoMessageListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination" ref="destinationTwo"/>
    <property name="messageListener" ref="jmsTwoListener" />
    <property name="autoStartup" value="false" />    
    <property name="sessionTransacted" value="true"/>
    <property name="concurrentConsumers" value="2" />
  </bean>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:16:16+00:00Added an answer on June 16, 2026 at 6:16 pm

    I agree with Tim’s answer: policies are defined on the underlying connection factory object. For your scenario, I think you’d need to define 2 seperate ActiveMQ connection factories with there own policy, then define a seperate Spring connection factory for each which is then used appropriately

    Here’s an example I’ve used on ActiveMQ v5.5 before:

    <bean id="rawConnectionFactory1" class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="${broker.url}" />
        <property name="redeliveryPolicy" ref="policy1" />
        <property name="useCompression" value="true" />
    </bean>
    <bean id="rawConnectionFactory2" class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="${broker.url}" />
        <property name="redeliveryPolicy" ref="policy2" />
        <property name="useCompression" value="true" />
    </bean>
    
    
    <bean id="policy1" class="org.apache.activemq.RedeliveryPolicy">
        <property name="initialRedeliveryDelay" value="20000" />
        <property name="useExponentialBackOff" value="false" />
        <property name="useCollisionAvoidance" value="false" />
        <property name="maximumRedeliveries" value="0" />
    </bean>
    <bean id="policy2" class="org.apache.activemq.RedeliveryPolicy">
        <property name="initialRedeliveryDelay" value="60000" />
        <property name="useExponentialBackOff" value="false" />
        <property name="useCollisionAvoidance" value="false" />
        <property name="maximumRedeliveries" value="5" />
    </bean>
    
    
    <bean id="connectionFactory1" class="org.springframework.jms.connection.CachingConnectionFactory">
        <property name="targetConnectionFactory" ref="rawConnectionFactory1" />
        <property name="sessionCacheSize" value="30" />
    </bean>
    <bean id="connectionFactory2" class="org.springframework.jms.connection.CachingConnectionFactory">
        <property name="targetConnectionFactory" ref="rawConnectionFactory2" />
        <property name="sessionCacheSize" value="10" />
    </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement performance testing on ActiveMQ, so have setup a basic
I have a message listener (using ActiveMQ) that implements SessionAwareMessageListener. When the onMessage(Message,Session) method
I have two queues on my application (Spring3-Hibernate-ActiveMq). Thanks for your comments in advance.
I'm trying to create simply connect with ActiveMQ using JNDI. I have: Queue named
I'm trying to view the contents of a topic using activemq-admin . This is
Using stomp.py (3.0.5) with python (2.6) alongside Apache ActiveMQ (5.5.1). I have got the
I'm trying to set up the following broker using JDBC persistence: <amq:broker id=activeMQBroker brokerName=activeMQBroker
I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB
I have a situation where I have a single activemq broker with 2 queues,
I have a project coded using Spring-hibernate-activeMq What I would like to know is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.