I would consider using Spring Integration . This makes it easy to configure JMS applications.
<bean id="commandQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue.command"/>
</bean>
<jms:message-driven-channel-adapter
id="jmsin" destination="commandQueue" channel="commandChannel" />
<int:channel id="commandChannel" />
So, in the XML snippet above, you create a “pipe”, which is the concept of an abstract queue. You define your JMS turn as usual, and then just define the adapter.
<service-activator input-channel="commandChannel"
ref="commandWatcher" method="processCommand">
<poller task-executor="pool">
<interval-trigger interval="100"/>
</poller>
</service-activator>
<bean id="commandWatcher" class="foo.bar.Pojo" scope="prototype"/>
<bean id="pool" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="8" />
</beans:bean>
, " ", , 100 , . , POJO. , , Serialized, . , , .
JMS , ...