Author |
Message
|
qizhirui |
Posted: Fri Jul 21, 2006 5:49 am Post subject: About put the message into the remote queue |
|
|
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 |
|
 |
bower5932 |
Posted: Fri Jul 21, 2006 6:08 am Post subject: |
|
|
 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 |
|
 |
qizhirui |
Posted: Fri Jul 21, 2006 7:07 am Post subject: thanks for your reply |
|
|
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 |
|
 |
wschutz |
Posted: Fri Jul 21, 2006 7:13 am Post subject: |
|
|
 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 |
|
 |
qizhirui |
Posted: Fri Jul 21, 2006 7:29 am Post subject: |
|
|
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 |
|
 |
zpat |
Posted: Fri Jul 21, 2006 7:32 am Post subject: |
|
|
 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 |
|
 |
wschutz |
Posted: Fri Jul 21, 2006 7:43 am Post subject: |
|
|
 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 |
|
 |
qizhirui |
Posted: Fri Jul 21, 2006 7:44 am Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Fri Jul 21, 2006 7:52 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Look-up 2085 in the MQ Messages manual, it will tell you what the problem is. _________________ -wayne |
|
Back to top |
|
 |
qizhirui |
Posted: Fri Jul 21, 2006 7:56 am Post subject: |
|
|
Novice
Joined: 24 Jun 2006 Posts: 14
|
wschutz wrote: |
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 |
|
 |
wschutz |
Posted: Fri Jul 21, 2006 9:19 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
|
Back to top |
|
 |
qizhirui |
Posted: Fri Jul 21, 2006 9:22 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Fri Jul 21, 2006 9:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
|
Back to top |
|
 |
|