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 » General IBM MQ Support » Connecting to a remote queue

Post new topic  Reply to topic
 Connecting to a remote queue « View previous topic :: View next topic » 
Author Message
rajesht1
PostPosted: Fri Jun 24, 2011 3:57 am    Post subject: Connecting to a remote queue Reply with quote

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
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Fri Jun 24, 2011 4:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
zpat
PostPosted: Fri Jun 24, 2011 4:34 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Jun 24, 2011 4:44 am    Post subject: Reply with quote

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
View user's profile Send private message
rajesht1
PostPosted: Fri Jun 24, 2011 4:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Fri Jun 24, 2011 4:59 am    Post subject: Re: Connecting to a remote queue Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Jun 24, 2011 5:09 am    Post subject: Reply with quote

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
View user's profile Send private message
rajesht1
PostPosted: Fri Jun 24, 2011 5:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Fri Jun 24, 2011 5:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Jun 24, 2011 6:00 am    Post subject: Reply with quote

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
View user's profile Send private message
shashivarungupta
PostPosted: Fri Jun 24, 2011 6:32 am    Post subject: Re: Connecting to a remote queue Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Connecting to a remote queue
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.