You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by BlueFox <bl...@gmail.com> on 2007/09/17 19:40:07 UTC
How to config spring and activeMQ properly?
For my application, I need the message to be redelivered infinite times
(exceptions etc) until the session is committed. My problem is the message
will redeliver for a few times (3 ~ 6 times) and no more message will be
processed for some reason. I find out there's MaximumRedeliveries in
Redelivery properties but I have no idea how to set it in spring's xml
config file.
Here's my current setting
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.org/config/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.org/config/1.0
http://activemq.apache.org/snapshot-schema/activemq-core-5.0-SNAPSHOT.xsd">
<!-- create an embedded ActiveMQ Broker -->
<amq:broker useJmx="false" persistent="false">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:0" />
</amq:transportConnectors>
</amq:broker>
<!-- ActiveMQ destinations to use -->
<amq:queue id="destination"
physicalName="com.Simulation" />
<!-- JMS ConnectionFactory to use, configuring the embedded broker using
XML -->
<amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost" />
<!-- wrap in a pool to avoid creating a connection per send -->
<bean id="connectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory" ref="jmsFactory" />
</bean>
<!-- Spring JMS Template -->
<bean id="jmsTemplate"
class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
</bean>
<!-- and this is the message consumer container -->
<bean id="consumerContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="concurrentConsumers" value="1" />
<property name="connectionFactory" ref="connectionFactory" />
<property name="destination" ref="destination" />
<property name="messageListener"
ref="upstreamMetricLoggingService" />
<property name="sessionTransacted" value="true" />
</bean>
</beans>
Please advice.
Regards,
--
View this message in context: http://www.nabble.com/How-to-config-spring-and-activeMQ-properly--tf4468429s2354.html#a12740924
Sent from the ActiveMQ - User mailing list archive at Nabble.com.