jeudi 26 mars 2015

JMS Queue not recieving messages with ActiveMQ

So I have used Spring integration to link JMS and ActiveMQ as under:-



<amq:broker useJmx="false" persistent="false">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:0" />
</amq:transportConnectors>
</amq:broker>

<bean id="amqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" p:brokerURL="tcp://localhost:61616"/>

<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue" c:name="destination"/>

<bean id="testTemplate" class="org.springframework.jms.core.JmsTemplate" depends-on="amqConnectionFactory" scope="prototype"
p:connectionFactory-ref="amqConnectionFactory"
p:pubSubDomain="false"
p:defaultDestination-ref="destination"
p:sessionTransacted="true"
p:receiveTimeout="5000"/>


Now, when I run the test by starting ActiveMQ and then running my application, I see that the messages are published to the "destination" queue from the logs. However, I am not able to retrieve any of these from the queue. Even in JConsole it shows the queueSize and counts as 0. How do I make it work so that I can send to and recieve messages from this queue? Please help.


Aucun commentaire:

Enregistrer un commentaire