activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mohit.jain" <>
Subject Consumer is created when a message is sent on other queue
Date Fri, 26 Jul 2013 10:10:55 GMT
Hi all,

I am facing an issue while developing a basic application of server client.
Each client will have a dedicated client queue to consume message from the
server and a single queue for a server to consume messages from the clients.

I am using apache-activemq-5.8.0 with spring framework.
This is my configuration file :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

    <context:component-scan base-package="com.test.common.orderapp" />

    <bean id="connectionFactory"
        <property name="brokerURL">
        <property name=""></property>
    <bean id="worker1" class="org.apache.activemq.command.ActiveMQQueue">
        <constructor-arg value="worker1Queue"/>
    <bean id="worker2" class="org.apache.activemq.command.ActiveMQQueue">
        <constructor-arg value="worker2Queue"/>
    <bean id="response" class="org.apache.activemq.command.ActiveMQQueue" >
        <constructor-arg value="responseQueue"/>
    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    	<property name="connectionFactory" ref="connectionFactory" />
        <property name="defaultDestination" ref="worker1" />
	<bean id="orderSender"
class="com.test.common.orderapp.producer.OrderSender"> </bean>
    <bean id="orderService"
    	<property name = "orderSender" ref = "orderSender" />
	<bean id="orderListener"
class="com.test.common.orderapp.listener.OrderListener"> </bean>

	      acknowledge="auto" >
	    	<jms:listener destination="responseQueue" ref="orderListener"
method="orderReceived" />

My question is:

There are basically two client with worker1 and worker2 queue.
Now whenever I load configuration file using 
ApplicationContext ctx = new
	    OrderService orderService = (OrderService) ctx.getBean("orderService");

"and send the message to any queue of worker a consumer is created on
response queue."

worker Queue: Consumer 1 Enqueue 10 Dequeue 10
Response Queue: Consumer 11 Enqueue 1 Dequeue 1

Some time messages also remain in pending state .

What can be the reason? Is my approach wrong ??

Thanks ,
Mohit Jain

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message