Reputation: 403
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 receives messages from this queue? Please help.
Upvotes: 0
Views: 173
Reputation: 22279
Why do you specify the transport connector to: tcp://localhost:0
and the ConnectionFactory URL to tcp://localhost:61616
?
I would use the same URL for both.
Upvotes: 1