It took me a while to work out how the JMS Samples were working and what they were doing.
I already had ActiveMQ running and couldn't understand why I couldn't see any messages on my queues (it was because it doesn't use an external broker!).
Could you add a comment in the common.xml or in the readme file to explain how it works?
e.g. explicitly note the differences between the vm and tcp property values
The other thing is that the demo runs so fast you have no time to look at the message on the queue.
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
<!--Uncomment if you don't have ActiveMQ installed and/or you want to run it all in memory (e.g. for unit tests)-->
<!--<property name="brokerURL" value="vm://localhost"/> -->
<property name="brokerURL" value="tcp://localhost:61616"/>
<property name="sessionCacheSize" value="10"/>
<property name="cacheProducers" value="false"/>
Having 2 separate test classes - one for put and one for get, would be clearer as well as it gives the newbie more clarity.
It is nice to do one operation, see the effect, then do another and see that effect.
As it is at the moment, because it all runs in one JVM and in memory, it is so fast it doesn't look like it uses queues at all!
I'm not suggesting we replace what is there, but merely add to it.
We then have
- Look how you can write to a queue!
- Now read it off!
- Wow! Look at it all together!
What do you think?