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 » About put the message into the remote queue

Post new topic  Reply to topic
 About put the message into the remote queue « View previous topic :: View next topic » 
Author Message
qizhirui
PostPosted: Fri Jul 21, 2006 5:49 am    Post subject: About put the message into the remote queue Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

i need to put the message into the remote queue ,choosing the binding mode not the client mode. when i program in java , face a problem that i can't put the message into the remote queue. But if i use the local queue instead of the remote queue,there is no problem .It succeeds in putting the message into the local queue. The java code may be long and hard for you to understand ,so i don't post the code here .
i hope that you give some advice or an example of java code about putting the message into the remote queue .please remeber that it is in binding mode not the client mode .
thanks.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
bower5932
PostPosted: Fri Jul 21, 2006 6:08 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

It shouldn't matter to your program whether it is client or binding connected. If you are using a definition of the queue (ie, QREMOTE, QLOCAL), then it shouldn't matter to your program either. Are you trying to put to a remote queue by specifying both the qmgr name and queue name and not using a QREMOTE? What kind of error are you getting?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
qizhirui
PostPosted: Fri Jul 21, 2006 7:07 am    Post subject: thanks for your reply Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

It shouldn't matter to your program whether it is client or binding connected. If you are using a definition of the queue (ie, QREMOTE, QLOCAL), then it shouldn't matter to your program either. Are you trying to put to a remote queue by specifying both the qmgr name and queue name and not using a QREMOTE? What kind of error are you getting?
==============================================================================================
i put to remote queue by specifying both the qmgr name and queue name, not using a QREMOTE .
can you give me an example of QREMOTE ? thanks
Back to top
View user's profile Send private message Send e-mail MSN Messenger
wschutz
PostPosted: Fri Jul 21, 2006 7:13 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

What error are you getting? You should be able to either use a QREMOTE definition (seach the info center for QREMOTE) or use the qmgr/queue name.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
qizhirui
PostPosted: Fri Jul 21, 2006 7:29 am    Post subject: Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

public void put(String xmlFileName) {
try {
String stringVar = parm.file2Bytes(xmlFileName);//read file transfer into string
if (stringVar != null) {
System.out.println("put message is : \n" + stringVar);
MQMessage msg = new MQMessage();
msg.writeBytes(stringVar);
MQQueueManager qm = getQManager();
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options= MQC.MQPMO_NONE;
MQQueue queue1 = getINQueue(qm);
queue1.put(msg,pmo); // putmessage
qm.disconnect();
}
}
the function is for putting the message into remote queue, the problem is in this function .
please have a look
Back to top
View user's profile Send private message Send e-mail MSN Messenger
zpat
PostPosted: Fri Jul 21, 2006 7:32 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Did you open the queue properly? remote queues can't be opened for INPUT, I have seen programmers who opened output queues for both input and output at the same time! (This works on local queues but not remotes and is bad practice!)
Back to top
View user's profile Send private message
wschutz
PostPosted: Fri Jul 21, 2006 7:43 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

wschutz wrote:
What error are you getting?
IF you want HELP you NEED to tell us what error you are getting.....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
qizhirui
PostPosted: Fri Jul 21, 2006 7:44 am    Post subject: Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

public void put(String xmlFileName) {
try {
String stringVar = parm.file2Bytes(xmlFileName);//read file transfer into string
if (stringVar != null) {
System.out.println("put message is : \n" + stringVar);
MQMessage msg = new MQMessage();
msg.writeBytes(stringVar);
MQQueueManager qm = getQManager();
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options= MQC.MQPMO_NONE;
MQQueue queue1 = getINQueue(qm);
queue1.put(msg,pmo); // putmessage
qm.disconnect();
}
the exception is as follows:
com.ibm.mq.MQException: MQJE001: 2, 2085
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2841)
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2898)
at MQConfigPackage.MQPutAndGetOperation.getINQueue(MQPutAndGetOperation.java:149)
at MQConfigPackage.MQPutAndGetOperation.put(MQPutAndGetOperation.java:65)
at MQConfigPackage.MQPutAndGetOperation.main(MQPutAndGetOperation.java:178)

the function getINQueue() is as flows:
private MQQueue getINQueue(MQQueueManager qm) {
try {
return qm.accessQueue(parm.getINQueueName(),
MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_BROWSE | MQC.MQOO_OUTPUT);
// MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_BROWSE | MQC.MQOO_OUTPUT);
}
i don't know whether open the remote queue or not. whether the operation of accessqueue is meaning to open the queue or not ?
pleasge give more details
Back to top
View user's profile Send private message Send e-mail MSN Messenger
wschutz
PostPosted: Fri Jul 21, 2006 7:52 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Quote:
2085
Look-up 2085 in the MQ Messages manual, it will tell you what the problem is.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
qizhirui
PostPosted: Fri Jul 21, 2006 7:56 am    Post subject: Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

wschutz wrote:
Quote:
2085
Look-up 2085 in the MQ Messages manual, it will tell you what the problem is.


please tell me where to download the MQ messages manual ,give me a concrete link to get it ,thanks.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
wschutz
PostPosted: Fri Jul 21, 2006 9:19 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

All MQ manuals are available online here:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
qizhirui
PostPosted: Fri Jul 21, 2006 9:22 am    Post subject: Reply with quote

Novice

Joined: 24 Jun 2006
Posts: 14

qizhirui wrote:
public void put(String xmlFileName) {
try {
String stringVar = parm.file2Bytes(xmlFileName);//read file transfer into string
if (stringVar != null) {
System.out.println("put message is : \n" + stringVar);
MQMessage msg = new MQMessage();
msg.writeBytes(stringVar);
MQQueueManager qm = getQManager();
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options= MQC.MQPMO_NONE;
MQQueue queue1 = getINQueue(qm);
queue1.put(msg,pmo); // putmessage
qm.disconnect();
}
the exception is as follows:
com.ibm.mq.MQException: MQJE001: 2, 2085
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2841)
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2898)
at MQConfigPackage.MQPutAndGetOperation.getINQueue(MQPutAndGetOperation.java:149)
at MQConfigPackage.MQPutAndGetOperation.put(MQPutAndGetOperation.java:65)
at MQConfigPackage.MQPutAndGetOperation.main(MQPutAndGetOperation.java:178)

the function getINQueue() is as flows:
private MQQueue getINQueue(MQQueueManager qm) {
try {
return qm.accessQueue(parm.getINQueueName(),
MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_BROWSE | MQC.MQOO_OUTPUT);
// MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_BROWSE | MQC.MQOO_OUTPUT);
}
i don't know whether open the remote queue or not. whether the operation of accessqueue is meaning to open the queue or not ?
pleasge give more details



the above problem is solved . The focus is the function:
qm.accessQueue(parm.getINQueueName(),
MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_BROWSE | MQC.MQOO_OUTPUT);
to make changes as follows , everything is OK.
qm.accessQueue(parm.getINQueueName(),openOptions, null, null, null);


Last edited by qizhirui on Fri Jul 21, 2006 9:23 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
fjb_saper
PostPosted: Fri Jul 21, 2006 9:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp
_________________
MQ & Broker admin
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 » IBM MQ Java / JMS » About put the message into the 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.