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