[jboss-user] [JBoss Messaging] - Re: How to send message to a remote queue

clebert.suconic@jboss.com do-not-reply at jboss.com
Thu May 7 15:57:03 EDT 2009


That's pretty much the procedure.

- you define a JMSPRoviderLoader. Give it a name

  |   <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
  |       name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
  |     <attribute name="ProviderName">MyProvider</attribute>
  |     <attribute name="ProviderAdapterClass">
  |       org.jboss.jms.jndi.JNDIProviderAdapter
  |     </attribute>
  |     <!-- The queue connection factory -->
  |     <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
  |     <!-- The topic factory -->
  |     <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
  |     <!-- Uncomment to use HAJNDI to access JMS
  |     <attribute name="Properties">
  |        java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
  |        java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
  |        java.naming.provider.url=localhost:1100
  |     </attribute>
  |     -->
  | 
  |   </mbean>

- you define the tx-connection-factory. make a reference to the provider loader using the property JmsProviderAdapterJNDI. Also define a JNDI name for the tx-connection-factory


  | <connection-factories>
  |   <tx-connection-factory>
  |     <jndi-name>MyConnectionFactory</jndi-name>
  |     <xa-transaction/>
  |     <rar-name>jms-ra.rar</rar-name>
  |     <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
  |     <adapter-display-name>JMS Adapter</adapter-display-name>
  |     <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
  |     <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/MyProvider</config-property>
  |     <security-domain-and-application>WhateverJmsXARealm</security-domain-and-application>
  |   </tx-connection-factory>
  | </connection-factories>
  | 



- In your code, use refer to JNDI name from tx-connection-factory:


  | javax.jms.ConnectionFactory factory = (javax.jms.ConnectionFactory)jndi.lookup("java:/MyConnectionFactory");
  | 


But all this is already defined on that Wiki. So I'm already providing you extra information.


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229538#4229538

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229538



More information about the jboss-user mailing list