activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MartyH <>
Subject redelivery confusion
Date Wed, 29 Nov 2006 15:47:19 GMT

Hi folks.

I'm working with activemq as an internal queue in a webapp to process these
things called activities.

I have a number of things I want to acheive.

when a message is delivered and a runtimeexception thrown from it on
processing it, I want it to stay on the queue and be redelivered.
when a message is delivered and being processed, should the queue go down
for any reason, it will be processed on startup again.

Basically my configuration looks like this:

  <bean id="jmsFactory"
    <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL"><value>${jms.url}</value></property>

  <bean id="deliveryModePersistent"

  <!-- Spring JMS Template wired to connection pool -->
  <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory"><ref local="jmsFactory"/></property>
    <property name="defaultDestinationName" value="${jms.queue}"/>
	<property name="deliveryMode"><ref

  <!-- Jencks configuration to wire the activity handler to the queue -->
  <bean id="jencks" class="org.jencks.JCAContainer">
    <property name="bootstrapContext">
      <bean class="org.jencks.factory.BootstrapContextFactoryBean">
        <property name="threadPoolSize" value="25"/>
    <property name="resourceAdapter">
      <bean id="activeMQResourceAdapter"
        <property name="serverUrl" value="${jms.url}"/>
        <property name="maximumRedeliveries" value="10"/>        

  <!-- Inbound message connector wired to the message listener -->
  <bean id="inboundConnectorA" class="org.jencks.JCAConnector">
    <property name="jcaContainer" ref="jencks" />
    <property name="activationSpec">
      <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
        <property name="destination" value="${jms.queue}"/>
        <property name="destinationType" value="javax.jms.Queue"/>
    <property name="ref" value="activityHandler"/>

what i'm seeing when a message throws an exception and fails to get
processed its not getting redelivered on broker restart:

journal.JournalPersistenceAdapter   455 ) Journal Recovery Started from:
Active Journal: using 2 x 20.0 Megs at:
(journal.JournalPersistenceAdapter   559 ) Journal Recovered: 2 message(s)
in transactions recovered.
(broker.BrokerService                372 ) ActiveMQ JMS Message Broker
(localhost, ID:BL-MHEND-XP-4004-1164812192568-1:0) started
(vm.VMTransportFactory               146 ) binding to broker: localhost
(broker.TransportConnector           208 ) Connector vm://localhost Started

bit lost as to why this is happening... i'd have expected those 2 messages
to get redelivered?  no?

hope you can help.


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message