(JBoss 3.2.3) I tried to use Session.setMessageListener(...) in my code, but nothing happened, after setting the MessageListener. If I create a TopicSubscriber and set a MessageListener on it, the messages get delivered to my MessageListener.
Looking at the source code of SpySession I have seen, that a new SpyMessageConsumer is created, if setMessageListener is invoked on a Session-Object. The SpyMessageConsumer is created with a parameter that states, that it is a session-consumer. There is a if statement, which prevents the creation of a MessageListener-Thread, if the consumer is a session-consumer.
Quoting the javadoc:
This is an expert facility not used by regular JMS clients