Step 1:
It would be a great idea to add Active MQ queues as datasource to JBoss
a) Add the activemq-ra.rar to the jboss deploy folder.
b) Add the file activemq-jms-ds.xml with the below example queues
===========================================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE connection-factories
PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN" "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd"> <connection-factories>
<tx-connection-factory> <jndi-name>activemq/QueueConnectionFactory</jndi-name> <xa-transaction/> <track-connection-by-tx/> <rar-name>activemq-ra.rar</rar-name> <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> <security-domain-and-application>JmsXARealm</security-domain-and-application> <ServerUrl>tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=1</ServerUrl> </tx-connection-factory> <tx-connection-factory>
<jndi-name>activemq/TopicConnectionFactory</jndi-name> <xa-transaction/> <track-connection-by-tx/> <rar-name>activemq-ra.rar</rar-name> <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> <security-domain-and-application>JmsXARealm</security-domain-and-application> <ServerUrl>tcp://localhost:61616</ServerUrl> </tx-connection-factory> <!-- Request and Response Queue Examples -->
<mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=some_queue_name"> <attribute name="JNDIName">activemq/queue/some_queue</attribute> <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends> <attribute name="Type">javax.jms.Queue</attribute> <attribute name="Properties"> PhysicalName=queue.some_queue </attribute> </mbean> <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=some_response_queue"> <attribute name="JNDIName">activemq/queue/some_response_queue</attribute> <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends> <attribute name="Type">javax.jms.Queue</attribute> <attribute name="Properties"> PhysicalName=queue.some_response_queue </attribute> </mbean> <!-- Topic Example -->
<mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.topic:name=some_topic"> <attribute name="JNDIName">activemq/topic/some_topic</attribute> <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends> <attribute name="Type">javax.jms.Topic</attribute> <attribute name="Properties"> PhysicalName=topic.some_topic </attribute> </mbean> </connection-factories>
=================================================================================================================
Step 2:
Add JNDI reference components for these Queues and Factories in ATG (below is example)
/some/package/TopicConnectionFactory
$class=atg.nucleus.JNDIReference
JNDIName=java:/activemq/TopicConnectionFactory
--------------------------------------------------
You are good to go.... |
Technology hub > Developer Handy >