1 Reply Latest reply on Aug 26, 2004 11:15 AM by adrian.brock

    purpose of Session.setMessageListener(...)

    superscout

      (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.