java - Post a message to a remote JMS queue using JBoss -


It sounds simple but I can not find a simple answer.

I want to open a connection Open a session in a remote JMS broker (known for IP and port), a specific queue (known as) and post a message in this queue .

Any easy Java API (if possible) to do this?

Given that I am running in Jebus, I still do not understand how to make it.


Edit

I actually gave the problem some thoughts (Hmmm) and if JMS needs to behave like JDBC , Then I have to use the client provided through my MQ implementation. Since we are using SonicMQ for our broker, I have decided to embed the sonic_Client.jar library provided with SonicMQ.

This is working in a standalone Java application and our Jabos service.

Thanks for the help

You have to use JMS, a QueueConnectionFactory and go from there. In fact how can you create QueueConnectionFactory vendor-specific (JMS is basically an example of a driver for message queues, such as for a JDBC database) but there is something on IBM MQ:

  MQQueueConnectionFactory Connection Factor = New MQQueueConnectionFactory (); ConnectionFactory.setHostName (& lt; hostname & gt;); ConnectionFactory.setPort (& lt; port & gt;); ConnectionFactory.setTransportType (JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); ConnectionFactory.setQueueManager (& lt; queue manager & gt;); ConnectionFactory.setChannel ("SYSTEM.DEF.SVRCONN"); QE connection queue connection connection = Factor.createQueueConnection (); Queue session queue session = connection.createQueue session (false, session .auto_ACKNOWLEDGE); Line queue = queue session White queue (& lt; queue name & gt;); Queenser Queenser = session. Sectarian sensor (queue); Qi receiver Qi receiver = session. Cut receiver (queue);  

Edit (edit the following questions)

The best way to reach a remote queue, or a queue for that , Add a line example for the JNDI registry For remote queues it is achieved using MBNs which add an Queue example when the server starts.

Take a look, while when it is an example with IBM MQ, you have to essentially connect to any remote queue.

If you want to create jbossmq-targets-service.xml and org.jboss.mq.server.jmx in relation to a jebaus queue Must see essential MBAs.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -