|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with client mode Java connection to remote queue |
« View previous topic :: View next topic » |
Author |
Message
|
heritam |
Posted: Fri Dec 10, 2004 6:11 am Post subject: Problem with client mode Java connection to remote queue |
|
|
Newbie
Joined: 10 Dec 2004 Posts: 3
|
Hello!
First I beg your pardon, but I'm brand new to MQ, and I still do not have experience to express myself completely correctly. However, I hope my description will be clear enough to point out the problem.
I have the following problem. I have to connect to a MQ server (which runs on a different machine than my application: that's why I must use client mode connection, or am I wrong?), from which my application would get requests and posts replies. The request queue is defined as local for the queue manager which I connect to, but the reply queue is remote.
For simplicity, I will refer to the QM, that I shall connect to (and which manages my request queue), as local QM. The another QM, which owns the remote queue will be reffered as remote
More precisely this is the definition file for the local QM:
Code: |
* for manager local (listening 1414)
*
* Local request queue
define qlocal('request') +
replace
* Local definition of remote queue
define qremote(feed) +
rname (feed.in) +
rqmname (remote) +
replace
* transmission queue
define qlocal(remote) +
usage (xmitq) +
replace
* sender channel
define channel (TRANS) +
chltype (sdr) +
descr ('Sender channel to remote') +
xmitq (remote) +
trptype (tcp) +
conname ('182.22.1.53(1412)') +
replace
* receiver channel (port listener)
define channel (JAVA) +
chltype (svrconn) +
trptype (tcp) +
mcauser (' ') +
replace
|
and the definition file for the remote QM:
Code: |
* for manager remote (listening 1412)
*
* local queue definition
define qlocal(feed.in) +
replace
* receiver channel
define channel (TRANS) +
chltype (rcvr) +
descr ('Receiver channel from local') +
trptype(tcp) +
replace
|
To provide the communication between the two QM, I have started two listeners and a channel:
Code: |
listener on [b]remote[/b]
$ runmqlsr -t tcp -p 1412 -m remote
04L1816, 5765-B75 (C) Copyright IBM Corp. 1994, 1999. ALL RIGHTS RESERVED.
10.12.04 12:42:37 Channel program started.
***
listener on [b]local[/b]
$ runmqlsr -t tcp -p 1414 -m local
04L1816, 5765-B75 (C) Copyright IBM Corp. 1994, 1999. ALL RIGHTS RESERVED.
10.12.04 12:57:33 AMQ9209: Connection to host 'lucy (182.22.1.11)' closed.
***
channel:
$ runmqchl -c TRANS -m local
04L1816, 5765-B75 (C) Copyright IBM Corp. 1994, 1999. ALL RIGHTS RESERVED.
10.12.04 14:27:33 Channel program started.
|
My Java program looks like the following:
Code: |
import com.ibm.mq.*;
import java.util.*;
class mqtest {
public static void main(String args[]) {
MQQueueManager qmgr = null;
int openOptions = 0;
try {
Hashtable properties = new Hashtable();
properties.put(MQC.HOST_NAME_PROPERTY, "182.22.1.53");
properties.put(MQC.PORT_PROPERTY, new Integer(1414));
properties.put(MQC.CHANNEL_PROPERTY, "JAVA");
properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
qmgr = new MQQueueManager("local", properties);
openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING;
}
catch (MQException e) {
System.err.println("Error:" +
" CC=" + e.completionCode +
" RC=" + e.reasonCode);
throw new NullPointerException("F*ck!!!");
}
try {
MQQueue qout = qmgr.accessQueue("feed" , openOptions);
}
catch (MQException e) {
System.err.println("Error:" +
" CC=" + e.completionCode +
" RC=" + e.reasonCode);
//throw new NullPointerException("F*ck!!!");
}
}
}
|
And of course I was never able to put messages (not even open) on the remote queue;
Quote: |
->$ java mqtest
Unable to load message catalog - mqji
Error: CC=2 RC=2085
|
With the local queue (named request) is O.K., but the remote (feed) always fails with this MQRC_UNKNOWN_OBJECT_NAME reason code.
Anybody knows why?
(Just in parantheses:
- I have tried the amqsput sample program, but it also fails, so I beleive the problem is in my queue setup
- I'm using Solaris 9
- Please do not ask me to change my reply queue to local, this was not my decision
- Please do not ask me to switch to JMS, this wasn't my decision, too
Thanks in advance. |
|
Back to top |
|
 |
heritam |
Posted: Fri Dec 10, 2004 6:16 am Post subject: just one more info ... |
|
|
Newbie
Joined: 10 Dec 2004 Posts: 3
|
Because I have only one machine, on which MQ intalled, I have to run both QM on the same machine! |
|
Back to top |
|
 |
Nigelg |
Posted: Fri Dec 10, 2004 6:36 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Your jave app opens queue feed, and you have defined the QR as FEED, since you did not put single quotes around th queue name. This also applies to the rqmname(remote). The attribute will be written as REMOTE, which will cause the msg to go the DLQ or be discarded when it reaches the 'remote' qmgr |
|
Back to top |
|
 |
heritam |
Posted: Fri Dec 10, 2004 2:02 pm Post subject: thank you |
|
|
Newbie
Joined: 10 Dec 2004 Posts: 3
|
You are right!
This was the problem, and now it has been solved. Hahhh!
I was fighting this one since a week!
But it is also a good experience: it is worth asking a question.
Thank you very much.
(anyway: such a brain-damaged config convention; without quotes it
counts as CAPITALIZED word ....) |
|
Back to top |
|
 |
Nigelg |
Posted: Sun Dec 12, 2004 2:12 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
With respect heritam, you should have read the manual before creating your objects, to check the rules for strings. |
|
Back to top |
|
 |
csmith28 |
Posted: Sun Dec 12, 2004 3:36 pm Post subject: Re: thank you |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
heritam wrote: |
You are right!
This was the problem, and now it has been solved. Hahhh!
I was fighting this one since a week!
But it is also a good experience: it is worth asking a question.
Thank you very much.
(anyway: such a brain-damaged config convention; without quotes it
counts as CAPITALIZED word ....) |
It's the little things that alway come back to bite us.
Early on, I was told that WMQ capitalizes everything that is not encased in ('text') because it was originally written so MainFrame Logical Partitions could pass messages to each other. While it was being developed it was discovered that this functionality would be very desirable for Cross Platform messaging as well. Then they added the ('') to support those other platforms.
I am not sure why someone at IBM hasn't said, "Why don't we change that on non z/OS platforms so when you type define ql(myqueue) it creates a local queue called "myqueue" instead of "MYQUEUE"...
This has just always been accepted as a standard for MQ.
You are not the first person who has made this mistake and you are not likely to be the last.
Like Nigel said, if you are going to be spending more time supporting WMQ and Applications that use WMQ, it would probably be a good idea to spend some quality time with the manuals.  _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|