many configuration sample files exist in ActiveMQ source distribution, also we can get lots of sample codes there.
someone try to set up a in-vm broker for testing that sends message asynchronously,and set useAsynSend="false". The tests failed intermittenly, the following modification make the tests get through:
=====add optimizedMessageDispatch====
<bean id="jmsConnectionFactory"
class="org.codehaus.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>vm://localhost</value>
</property>
<property name="useEmbeddedBroker">
<value>true</value>
</property>
<property name="optimizedMessageDispatch">
<value>true</value>
</property>
...
</bean>