activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aneesh <cv_ane...@yahoo.co.in>
Subject Re: Advisory Messages
Date Tue, 14 Jun 2011 13:09:34 GMT
atlast i got it resolved..
This is how it works now..


Defined a topic <amq:topic id="brokerConnAdvisoryT"
physicalName="ActiveMQ.Advisory.Connection" />
in my embedded broker.

Defined a listener class (which is the java class which will have the logic
built in to identify whether 
a connection has been obtained/lost)
<bean id="brokerConnAdvisoryListener"
class="com.arbitron.pmi.messaging.outbound.BrokerConnectionAdvisory">
</bean>

Defined a container using the DefaultMessageListenerContainer and the
listener is set as the listener bean defined above

<bean id="brokerConnAdvisoryContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">    
	    <property name="connectionFactory" ref="jmsFactory" />    
	    <property name="destination" ref="brokerConnAdvisoryT" />   
        <property name="messageListener" ref="brokerConnAdvisoryListener" />	      
		
</bean>

Now the brokerConnAdvisoryListener will get triggered whenever an
AdvisoryMessage is sent to the topic "ActiveMQ.Advisory.Connection" and i
can use my logic to check whether the consumers connection has lost on the
server..:-)

--
View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-Messages-tp3552270p3596506.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message