ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Connection to remote queue using JMS and JNDI

Post new topic  Reply to topic
 Connection to remote queue using JMS and JNDI « View previous topic :: View next topic » 
Author Message
psymmtw
PostPosted: Wed May 30, 2012 9:40 am    Post subject: Connection to remote queue using JMS and JNDI Reply with quote

Newbie

Joined: 30 May 2012
Posts: 3

Hi,

Sorry if the the answer is blindingly obvious, but it has stumpt me all day.

I have the following setup

MACHINE A:
Hostname: machineA
JMS client application (WSO2 ESB to be exact)
Websphere MQ 6 client


MACHINE B:
Hostname: machineB
Websphere MQ 6 Server
Queue Manager - Name: MSOLU05
Queue - Name: "REQUEST.QUEUE"
Port: 1410

From the client application on machine A, I'd like to be able to connect to the queue manager on Machine B and pull messages from the queue "REQUEST.QUEUE". That seems fairly easy if using a non-JNDI setup. However, the application program only supports retriving the JMS factories and settings via JNDI. The problem I'm trying to figure out is how to publish the details of the queue via JNDI, so that the queue can be accessed remotely.

I've looked at the JMSAdmin tool, and created a connection factory,

Code:
DEFINE QCF(QueueConnectionFactory) QMGR(MSOLU05) HOST(machineB) PORT(1410) TRANSPORT(CLIENT)


However, when it comes to publishing the queue details, I'm not sure how to specify that it is a remote queue. I've entered the below into the JMSAdmin

Code:
DEFINE Q(TestQueue) QMGR(MSOLU05) QUEUE(REQUEST.QUEUE)


I originally thought that I could just add TRANSPORT, PORT and HOST to this line, but according to the IBM documentation, non of these properties are supported by the Q object. So I'm left scratching my head has to how to connect via JMS using JNDI to a remote MQ queue. If someone could point me in the right direction, that would be most appreciated.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed May 30, 2012 9:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So JNDI acts as a holder of information.

You configure the InitialContextFactory to know how to connect to the JNDI that holds the relevant information that you need.

You then ask for a QueueConnectionFactory from the JNDI by the name that was used to define it.

JMSAdmin is a tool that can be used to populate a JNDI. In order for it to be successful, it must be configured to know how to connect to the JNDI you want to use.

I suspect you will find that by default, it uses a file based initial context. You can then take this file, and provide it to the JMS application, and instruct the JMS Application on how to configure it's InitialContext to use this file and the file based initial context.
Back to top
View user's profile Send private message
psymmtw
PostPosted: Thu May 31, 2012 1:26 am    Post subject: Reply with quote

Newbie

Joined: 30 May 2012
Posts: 3

I have already connected the JMS client app to the JNDI repository.

The problem I'm having is how to correctly define the Q object in JMSAdmin so that the client app will know that the queue is a remote queue on machineB.

All the examples in the IBM documentation and the ones I can find on the web are all cases where the JMS client is running on the same host as the Websphere MQ queue (i.e. connecting to a local queue).
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 31, 2012 1:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You don't tell the client app that the queue is a remote queue.

You merely tell it the name of the queue. The queue manager the app is connected to will know that it is a remote queue from that queue manager, and know how to send it data.

You do not need to specify anything in the QMGR on the Q definition parameter, unless your mq administrator tells you to.

And remember - No MQ application can READ messages from queues that are not QLOCALS on the queue manager they are connected to.

You only need connection information - host, channel, port, to identify how to find the queue manager you want to connect to. Once you've connected, MQ handles all of the network details for you, you only use Queue name and sometimes queue manager name to address messages.
Back to top
View user's profile Send private message
psymmtw
PostPosted: Thu May 31, 2012 1:57 am    Post subject: Reply with quote

Newbie

Joined: 30 May 2012
Posts: 3

Thanks for the explaination. That makes things a lot clearer. Much appreciated.
Back to top
View user's profile Send private message
akidase
PostPosted: Fri Oct 26, 2012 1:50 pm    Post subject: Reply with quote

Centurion

Joined: 10 Jan 2011
Posts: 124

Quote:
I have already connected the JMS client app to the JNDI repository.


Please let me know, how you accomplished it ?

Was it Broker (JMS Node ) or Java program or.. ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Connection to remote queue using JMS and JNDI
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.