Author |
Message
|
rajesht1 |
Posted: Fri Jun 24, 2011 3:57 am Post subject: Connecting to a remote queue |
|
|
Novice
Joined: 23 Jun 2010 Posts: 21
|
I have developed a code to connect to a remote queue in java.
But it is working fine in local.
can any one please provide me the code to connect to a remote queue in a remote queuemanager.
Thanks in advance for all your help!! |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Jun 24, 2011 4:26 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
This seems to be an MQ question, mod may want to move it to the MQ forum.
The API is exactly the same whether or not the queue is local or remote. There is no difference. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
zpat |
Posted: Fri Jun 24, 2011 4:34 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
The best way is to use a CCDT URL and set up a CCDT.
Any MQ client connection must have a hostname, port, channel name. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 24, 2011 4:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's not clear what is meant by a 'remote queue'.
Is this "GET LOCAL, PUT GLOBAL'? Or is this 'client connect vs. bindings connection' ? |
|
Back to top |
|
 |
rajesht1 |
Posted: Fri Jun 24, 2011 4:58 am Post subject: |
|
|
Novice
Joined: 23 Jun 2010 Posts: 21
|
MQEnvironment.hostname=hostName;
MQEnvironment.port=portNo;
MQEnvironment.channel="SYSTEM.DEF.SVRCONN";
MQQueueManager qMgr;
System.out.println("putGroup started....");
MQException.log = null;
qMgr = new MQQueueManager(iQmgr);
int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
MQQueue myQueue =
qMgr.accessQueue(iQueue, openOptions, null, null, null);
MQMessage myMessage = new MQMessage();
//myMessage.messageId = null;
//myMessage.correlationId = null;
//myMessage.groupId = null;
// myMessage.clearMessage();
myMessage.writeString(userInput);
myMessage.format = MQC.MQFMT_STRING;
myMessage.messageFlags = MQC.MQMF_MSG_IN_GROUP;
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_LOGICAL_ORDER | MQC.MQPMO_SYNCPOINT;
myQueue.put(myMessage, pmo);
I have used the above code to put a message in a remote queue.But it is not working in remote it is working in local only.
can anyone please help me on this |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jun 24, 2011 4:59 am Post subject: Re: Connecting to a remote queue |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
rajesht1 wrote: |
But it is working fine in local.
|
Exactly how is it not working fine remotely?
And by exactly I mean... what symptoms, what error messages, what ReasonCodes? Please provide us some useful information.
"It doesn't work." is not a technical statement of a problem. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 24, 2011 5:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What does it mean "remote"?
A queue on a different qmgr than the one you are connected to?
A queue that is on a qmgr that is not on the machine your program is running on? |
|
Back to top |
|
 |
rajesht1 |
Posted: Fri Jun 24, 2011 5:33 am Post subject: |
|
|
Novice
Joined: 23 Jun 2010 Posts: 21
|
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2058
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:282)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:186)
I am getting the above error while putting the message in a remote queue in a remote queue manager |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jun 24, 2011 5:38 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
and when you went to google, and searched for mq reason code 2058, what did that lead you to believe? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 24, 2011 6:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rajesht1 wrote: |
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2058 |
And which of the documented resolutions have you tried so far? There's no point us suggesting something which has already failed to help. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Fri Jun 24, 2011 6:32 am Post subject: Re: Connecting to a remote queue |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
rajesht1 wrote: |
I have developed a code to connect to a remote queue in java.
But it is working fine in local.
can any one please provide me the code to connect to a remote queue in a remote queuemanager.
|
I think by that he means, he is able to access RQD on his local qmgr But not on remote queue mgr ?
Am not sure whether I've understood him fully and correctly.
Anyways.. if you have some issues in your code then you can check the Sample programs that come with WMQ Package. Or 'WebSphere MQ Application Programming Reference Redbook'
For your mqrc 2058 : check here _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
|