Try using the failover transport for your  remoteJmsConnectionFactory. This
way the connection to the remote will be auto retried if the remote gets
bounced or you lose the network. For example, 

failover:(tcp://remotehost:61616)

You other option is to set up a forwarding bridge between the embedded and
remote broker.

Hope this helps,
Joe
www.ttmsolutions.com




M4RC0 wrote:
> 
> I'm ussing AMQ 5.0
> better, I post my spring jms configuration:
> <!-- local broker connection factory to assume all local jms messages -->
>       <bean id="localJmsConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>               <property name="brokerURL" value="vm://localhost" />
>       </bean>
> 
>       <!-- common jms template for all producers, all messages must be 
> received
> in local connection factory  -->
>       <bean id="localJmsTemplate"
> class="org.springframework.jms.core.JmsTemplate">
>               <property name="connectionFactory" 
> ref="localJmsConnectionFactory" />
>               <property name="sessionAcknowledgeModeName" 
> value="CLIENT_ACKNOWLEDGE"/>
>               <property name="defaultDestination" ref="destination"/>
>               <qualifier value="localJmsTemplate"/>
>       </bean>
> 
>       <!-- default destination for local messages -->
>       <bean id="destination" class="org.apache.activemq.command.ActiveMQQueue"
> autowire="constructor">
>               <constructor-arg value="defaultLocalQueue" />
>       </bean>
>       
>       <!--  listener container for receiving local messages and dispatch them
> to each respective remote queue -->
>       <bean
> class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>               <property name="connectionFactory" 
> ref="localJmsConnectionFactory" />
>               <property name="destination" ref="destination" />
>               <property name="sessionAcknowledgeModeName" 
> value="CLIENT_ACKNOWLEDGE"/>
>               <property name="messageListener">
>                       <bean class="com.mycompany.jms.MessageRouterListener">
>                               <constructor-arg ref="remoteJmsTemplate" />
>                       </bean>
>               </property>
>       </bean>
>       
>       <!-- jms template to be used by the local dispatcher listener to deliver
> messages to remote jms server -->
>       <bean id="remoteJmsTemplate"
> class="org.springframework.jms.core.JmsTemplate">
>               <property name="connectionFactory">
>                       <!-- lets wrap in a pool to avoid creating a connection 
> per send -->
>                       <bean
> class="org.springframework.jms.connection.SingleConnectionFactory">
>                               <property name="targetConnectionFactory"
> ref="remoteJmsConnectionFactory" />
>                       </bean>
>               </property>
>               <property name="defaultDestination" ref="destination"/>
>               <qualifier value="remoteJmsTemplate"/>
>       </bean>
>       
>       <!-- remote broker connection factory where finally jms messages will be
> delivered -->
>       <bean id="remoteJmsConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>               <property name="brokerURL"
> value="tcp://remotehost:61616?wireFormat.maxInactivityDuration=0" />
>       </bean>
> 

-- 
View this message in context: 
http://www.nabble.com/HOWTO-resend-msgs-from-embedded-broker-to-remote-broker-that-was-down-tp18214129p18215084.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to