3 Replies Latest reply on Jul 17, 2009 11:32 AM by yashendra chandrakar

    defining/creating messaging Queue through @ActivationConfigP

    yashendra chandrakar Newbie

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

      In jboss MQ I don't have to define Queues and Topics in any configuration xml if I have @ActivationConfigProperty annotation 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
      @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/event")

      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.