views:

418

answers:

2

Hey All,

I want to send messages to remote queue ? what steps should i do i cant find any documentation about that ? anyone can help ?? ?

A: 

Look in docs/examples of your jboss installation. The only change needed to connect to a remote queue is to set up your initial context to refer to the remote appserver's JNDI port.

pra
A: 

Add another "JMSProvider" in your ${JBOSS_CONF}/deploy/messaging/jms-ds.xml. I use the provider name "RemoteJMSProvider" in this example:

RemoteJMSProvider org.jboss.jms.jndi.JNDIProviderAdapter XAConnectionFactory XAConnectionFactory XAConnectionFactory java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jnp.interfaces java.naming.provider.url=your_remote_host:1099

Next, add a "Remote Connection Factory":

RemoteJMSConnectionFactory jms-ra.rar org.jboss.resource.adapter.jms.JmsConnectionFactory javax.jms.Queue java:/RemoteJMSProvider 20 JmsXARealm jboss.messaging:service=ServerPeer

Now, anytime you create a connection factory reference to "RemoteJMSFactory", any queue you reference will be looked-up on the remote server:

ConnectionFactory factory =(ConnectionFactory)JNDIContext.lookup("java:/RemoteJMSConnectionFactory");

queue = (Destination) JNDIContext.lookup("queue/myqueue"); connection = factory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer sender = session.createProducer(queue); sender.send(jmsMessage);

See also: http://community.jboss.org/wiki/HowDoIConfigureAnMDBToTalkToARemoteQueue

Robert Durgin
thank u very much i have it done
Taha Yusuf