2 Replies Latest reply on Jul 21, 2009 9:45 AM by yashendrac

    How to define Queue using annotations in MDB without config

    yashendrac

      I wonder if it is mandatory to define Queues and Topics in xml in JBoss5.1.0 JBoss Messaging. Is there any way to make it work the way it used to in JBoss4.2.1 Jboss MQ, i.e. just use the annotations in message consumer/MDB without defining in any xml?

      In JBoss 4.2.1 jboss MQ I don't have to define Queues and Topics in any configuration xml if I have @ActivationConfigProperty annotations in my MDB like this:

      @MessageDriven(activationConfig = {
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
       @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
       @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
       @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/event"),
       @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "Alarm = FALSE")})


      But after moving same code to Jboss Messaging my MDB is not able to find the specified Queue in that MDB

      I am able to resolve this problem by defining all my Queues and Topics in destination-service.xml located under deploy/messaging/destination-service.xml.

      But I don't want to configure these in any xml outside of my application and would prefer using annotation in class itself.

      Any suggestion would be highly appreciated.