Question

I have an MDB that manages to consume ActiveMQ advisory messages when deployed on glassfish.

But when i deploy on tomEE this MDB doesnt consume any advisory messages. Is there something I need to turn on?

@MessageDriven(mappedName = "ActiveMQ.Advisory.Consumer.Queue", activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "ActiveMQ.Advisory.Consumer.Queue.User.*") })
public class AdvisoryMdb implements MessageListener {
    private final Logger logger = LoggerFactory.getLogger(getClass().getName());

    @Override
    public void onMessage(Message message) {
        logger.info("onMessage() {}", message);
    }
}

(In TomEE I manage to successfully produce and consume messages on these queues i want to advisories for)

edit: i tested to consume on one of these advisory topics with a standalone client and got the messages as expected. So the advisory messages are successfully sent, just that my mdb doesnt pick them up properly.

Was it helpful?

Solution 2

By chance i attempted to remove

mappedName = "ActiveMQ.Advisory.Consumer.Queue"

from the @MessageDriven annotation and suddenly it works on both TomEE and glassfish. Not sure why I added that in the first place, guess it was not needed for glassfish either.

OTHER TIPS

What Advisory messages are you trying to consume?

Taking a look at the documentation here... I see ActiveMQ.Advisory.Consumer.Queue is listed meaning as Consumer start & stop messages on a Queue. Your target is ActiveMQ.Advisory.Consumer.Queue.User.*, So do you have a queue called User? Is this a single queue or are there multiple queues underneath User?

Also reading the doc, there seems to be some changes over the years of the Advisory queue names. Can you check the ActiveMQ versions across the platforms and make sure you're comparing apples to apples? Also, on the documentation page I listed, I kind of wonder if some of the advisories are disabled. It doesn't list that particular queue as one that can be disabled, but you might try explicitly enabling all advisories and see if that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top