0

I'm trying to implement a service which listens to a topic to receive messages sent to that topic. The code is quite simple:

@MessageDriven(mappedName="jms/TEST", activationConfig={
    @ActivationConfigProperty(propertyName="destinationType",propertyValue="javax.jms.Topic"),
    @ActivationConfigProperty(propertyName="subscriptionName",propertyValue="TEST")
    })
    public class MessageListener implements MessageListener {

    private static final Logger logger = Logger.getLogger(MessageListener.class);

    @Override
    public void onMessage(Message arg0) {
        logger.info("Receiving " + arg0);
    }
}

The listener is deployed on Glassfish. In Glassfish, I also add an Admin Object Resource:

JNDI Name: jms/TEST
Resource Adaptor: jmsra
Resource Type: javax.jms.Topic
Class Name: com.sun.messaging.Topic
Name: TEST
Physical Name: TEST

I have another service, also in Glassfish, sending messages to topic TEST. However, my listener doesn't receive any messages at all. I create another service listening to the same topic without using Message Driven Bean and am able to receive, i.e. a message is sent without any problem. I wonder if I do anything wrong with my bean.

L

Long Thai
  • 807
  • 3
  • 12
  • 34
  • try using http://sourceforge.net/projects/qbrowserv2/ to see what is really happening in glassfish JMS.. – mantrid Feb 01 '13 at 15:12
  • Either the message never arrives because of client coding or configuration error OR the listener isn't properly assigned to the queue. You should be able to turn off the listener and see messages arriving when you test the client. If that works, then the issue has to be the listener. – duffymo Feb 01 '13 at 15:24
  • I believe it's listener's issue as client is working fine. I don't know if it matters but I want to use message topic instead of message queue so that message can be broadcast to different listeners. – Long Thai Feb 01 '13 at 15:58

0 Answers0