2 Replies Latest reply on Mar 31, 2009 11:02 AM by Paul Pacheco

    Configuring external jms datasource with MQSeries

    James ORourke Newbie

      I'm posting here after much research into this matter.

      Currently, we are using wmq.jmsra.rar resource adapter with jboss 4.2.2 successfully. Essentially, all the configuration we have is in EJB 3.0 annotations, as follows:

      @MessageDriven(mappedName = "FilmMDB" activationConfig = {
       // Note: the values inside strings here with @....@ pattern are replaced by the build
       // script
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
       @ActivationConfigProperty(propertyName = "destination", propertyValue = "FundTransactionTopic"),
       @ActivationConfigProperty(propertyName = "channel", propertyValue = "@MDBChannel@"),
       @ActivationConfigProperty(propertyName = "hostName", propertyValue = "@MDBHostName@"),
       @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "@MDBQueueManager@"),
       @ActivationConfigProperty(propertyName = "port", propertyValue = "@MDBPort@"),
       @ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
       @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
       @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "@MDBDurable@"),
       @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "FilmSub"),
       @ActivationConfigProperty(propertyName = "clientID", propertyValue = "MyId") })
      @ResourceAdapter(value = "wmq.jmsra.rar")
      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
      @TransactionManagement(TransactionManagementType.BEAN)
      public class FilmMDB implements MessageListener {....}


      This works for now however, the problem is, I would like to have the configuration for the queue/topic be external to the code and to the application configuration. I realize we could use a deployment descriptor, however, that would still require packaging with the ear. Ultimately, what is desirable is to configure the MDB to use a connection factory in a similar way to a datasource for db connections. I have attempted to follow the instructions here:

      http://wiki.jboss.org/wiki/UsingWebSphereMQSeriesWithJBossASPart4

      but with limited success. It seems that the connection factory setup is for clients and there is no way to attached a connection factory to an MDB. Is this true? Any suggestions would be greatly appreciated.