activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dirful_zone <>
Subject How to add a TransportListener in spring.
Date Wed, 19 Aug 2009 08:32:46 GMT

Hi, this is dirful.
    I have two questions.Firstly, I found FAQ said if 'boker' a remote URL,
it need third tool such as jconsole or other else, isn't it? 
    And now, this is the second question. I make a project that there're two
applications A and B. The work flow like this: A----send message
----MQ------recieve message ------B , and B----send message
----MQ------recieve message ------A.  Because of using Struts, I invoke a
method in action to send a message, and I configued a ListenerContainer in
spring to monitor MQ. For example, when A send a message, B can receive it
quickly. The same to B do it. 
     I have implemented it used url "tcp:localhost....". But there's a
problem, when MQ is down, I let A send a message,of course,A connect the
port once more and the message send success. but B doesn't konw the MQ
restart until it send a message to A.
     I have look for FAQ, and I got that use "failover:tcp....." and add
TransportListener can resolve it.
     You see, I configured connenctionFactory, destination and so on in
spring's xml. So I don't konw how to add a TransportListener to a connetion
like this.

     This is my xml.(The JNDI is configured in Tomcat's xml)

<?xml version="1.0" encoding="UTF-8"?>   
<beans xmlns=""   
    <bean id="jmsConnectionFactory"   
        <property name="jndiName"
    <bean id="jmsQueue1"   
        <property name="jndiName"
        <bean id="jmsQueue2"   
        <property name="jndiName"
    <bean id="jmsTemplate"   
        <property name="connectionFactory"
        <property name="defaultDestination" ref="jmsQueue1"></property>   
    <bean id="sender" class="message.Sender">   
        <property name="jmsTemplate" ref="jmsTemplate"></property>   
    <bean id="receive" class="message.Receiver"></bean>   
    <bean id="listenerContainer"   
        <property name="connectionFactory"
        <property name="destination" ref="jmsQueue2"></property>   
        <property name="messageListener" ref="receive"></property>   

     Eagerly look forward to your help.
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message