tags:

views:

619

answers:

0

I need to create a durable subscription to a topic in JBoss 4.2.1-GA. In order to do this I need to create a connection to the topic using a connection factory that has a specific clientId value associated with it.

I know it can be done by configuring a Connection Factory in JBoss using xml but I can't find any examples that work for me. How do I configure a connection factory using the xml descriptors?

Also, can a connection factory be created programatically? If so, how do I do it?

My topic is configured in jbossmq-destinations-service.xml as follows.

<mbean code="org.jboss.mq.server.jmx.Topic"
  name="jboss.mq.destination:service=Topic,name=myTopicName">
  <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
  <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
  <attribute name="SecurityConf">
      <security>
          <role name="guest" read="true" write="true" create="true"/>
          <role name="publisher" read="true" write="true" create="false"/>
          <role name="durpublisher" read="true" write="true" create="true"/>
      </security>
  </attribute>
</mbean>

One other point to note is that I am connecting to the topic from a remote JBoss instance. Both JBoss instances are 4.2.1-GA and have exactly the same configuration except that the topic above only exists on the server JBoss.

Thanks.