Author |
Message
|
MichaelHartman |
Posted: Fri Nov 02, 2001 8:18 am Post subject: |
|
|
 Newbie
Joined: 01 Nov 2001 Posts: 4
|
I have an application which puts messages to a queue on Q mgr 'A' and receives messages from a queue on Q mgr 'B'. Both Q mgr A and B are on the same Solaris server. The application first opens the output queue on mgr A, then it opens the recv queue on mgr B.
If I use the bindings transport, then the output queue on mgr A is opened successfully, but when opening the input queue on mgr B, I get the error javax.jms.JMSException: MQJMS1017: non-local MQ queue not valid for receiving or browsing.
If I use the TCP/IP transport for either Q mgr A or B (i.e. use bindings mode for only one of the Q mgrs) then everything is fine.
This behavior sounds like some info from the first bindings Q mgr connection is being used with the second bindings Q mgr connection. I am always setting the Q mgr name.
Env: Solaris 7, IBM MQ JMS 5.2, jdk 1.2.2_006
If anyone has experienced this problem or has any suggestions, it would be appreciated.
Thanks,
Mike Hartman
|
|
Back to top |
|
 |
kolban |
Posted: Fri Nov 02, 2001 9:51 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Maybe take us through the high level logic of your access to the queue managers. It sounds like you need two connection factories, one for each of your queue managers? |
|
Back to top |
|
 |
MichaelHartman |
Posted: Fri Nov 02, 2001 10:12 am Post subject: |
|
|
 Newbie
Joined: 01 Nov 2001 Posts: 4
|
The output queue logic is implemented via the MQOutputDest class, whose constructor does:
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
if ( transportType is TCPIP )
factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
factory.setHostName( "localhost" );
factory.setPort( 3510 );
factory.setQueueManager( "MQAEG009" );
mQueueConn = factory.createQueueConnection();
The QueueSession and QueueSender creation are deferred until a thread wants to put a message to the MQOutputDest instance, and are created on a per thread basis.
The input queue logic is implemented in the MQInputSource class, whose constructor does:
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
if ( transportType is TCPIP )
factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
factory.setHostName( "localhost" );
factory.setPort( 3520 );
factory.setQueueManager( "MQAES009" );
mQueueConn = factory.createQueueConnection();
mRecvSession =
mQueueConn.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
mQueue = mRecvSession.createQueue( "queue://MQAES009/IN_QUEUE_NAME" );
mQueueReceiver = mRecvSession.createReceiver( mQueue, selector );
The app first constructs the MQOutputDest instance, then the MQInputSource instance. The non-local queue error occurs during the MQInputSouce construction.
[ This Message was edited by: MichaelHartman on 2001-11-02 10:13 ]
[ This Message was edited by: MichaelHartman on 2001-11-02 10:15 ] |
|
Back to top |
|
 |
simon.starkie |
Posted: Wed Apr 09, 2003 5:44 pm Post subject: MQJMS1017: non-local MQ queue not valid for receiving or bro |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
I have the same problem when using the MQ JMS Sample if it is configured in JNDI as a Client to a Remote Queue Manager (on another server, not on my WIN23 server). It works fine in either BINDING or CLINET mode if I run against a LOCAL qmgr on my WIN23 server.
I thought LOCAL in MQ terminology meant some like "the qmgr to which you are connected is your local qmgr". It does not mean my local server.
Is there a JMS reason why I can't get (receive or browse) messages from a LOCAL qmgr that is on another server (i.e. LOCAL because I connected to it as a CLient). I know I can do this with the MQI.
Thanks  |
|
Back to top |
|
 |
vennela |
Posted: Wed Apr 09, 2003 6:37 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
If you are trying to JMS client connect to a QMGR then your QueueConnectionFactory should be defined with a few parameters like
qmgr
hostname (host name of the box where the queue manager is running)
port (the port on which the listener is runnng on)
channel (svrconn channel)
transport (client)
Most likely you are mising one of those properties in your JMS Object definitions.
-------
Venny |
|
Back to top |
|
 |
simon.starkie |
Posted: Wed Apr 09, 2003 7:16 pm Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Thanks Vennela.
Yes, I definitly have those parms.
Here is what I have defined in JNDI to access the remote queue mgr as a clinet:
DEFINE QCF(QCF) +
FAILIFQUIESCE(YES) +
QMANAGER(QM1) +
USECONNPOOLING(YES) +
TRANSPORT(CLIENT) +
CHANNEL(SYSTEM.DEF.SVRCONN) +
HOSTNAME(AnnStarkie) +
PORT(1416)
The HOSTNAME resolves to an AIX Server.
p.s. I know this definition works if the HOSTNAME points to my local WIN2003 server...but when I change the HOSTNAME (only that) to point the HOSTNAME at a remote server I get the error... |
|
Back to top |
|
 |
vennela |
Posted: Wed Apr 09, 2003 8:16 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Don't know what the problem is.
You should double check your definitions once again.
Is the QMGR name correct. Is the hostname resolvable. can you ping it. is the port number 1416 right. Is the port listening.
What is the error that you are getting. Are you running PTPSample01.
-------
Venny |
|
Back to top |
|
 |
simon.starkie |
Posted: Thu Apr 10, 2003 11:51 am Post subject: MQJMS1017: non-local MQ queue not valid for receiving or bro |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
The error I got was
MQJMS1017: non-local MQ queue not valid for receiving or browsing
I think the MQJMS017 message verbage is very misleading for this particular case (a mismatch between QCF and Q with respect to the MQ Queue and the MQ Qmgr that owns it). I would like to suggest that perhaps Hursely change the verbage of the MQJMS017 message to say something like "unable to receive or browse specified Queue <q-name>".
The term "local" is very misleading.
I was using the PTSAMPLE01 JMS sample that comes with MQ 5.3. I only made one small change to the PTSAMPLE01 code to specify my own QCF and Queue as follows:
// The following can be modified if you want to experiment with
// using other administered objects with different content.
public static final String qcfLookup = "TADAS00"; // "QM1";
public static final String qLookup = "testQueue"; //"testQueue";
The root cause of the problem (for me) was the fact that the definitions in JNDI for the Q referenced a different MQ qmgr than the MQ qmgr which was referenced by the QCF that I was using. See below.
The QCF I was using looked like this:
DEFINE QCF(TADAS00) +
FAILIFQUIESCE(YES) +
QMANAGER(TADAS00) +
TRANSPORT(CLIENT) +
CHANNEL(SYSTEM.ADMIN.SVRCONN) +
HOSTNAME(ktazd10.crdc.kp.org) +
PORT(51416)
The Q I was using looked like this:
DEFINE Q(testQueue) +
QMGR(QM1) +
QUEUE(testQueue)
Hope that helps someone else who may encounter this opportunity. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 10, 2003 1:15 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It seems to me that you were telling your QCF to connect to one queue manager, and then telling your code to open a queue on another queue manager for input.
You can only open queues for input that are local to the queue manager you are connected to.
You were actually creating two connections, one for input and one for output. But again, your connection parameters for both pointed to the same queue manager when you really wanted them to point to different queue managers.
So it was doing what you told it to, just not what you wanted it to. |
|
Back to top |
|
 |
simon.starkie |
Posted: Thu Apr 10, 2003 1:23 pm Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Not exactly. I was connecting to one qmgr and then trying to BOTH send (occurs first in the PTPSAMP01 sample) AND receive (occurs later in the PTPSAMP01 sample) to/from a queue that was associated with another qmgr. The verbage of the message was misleading because it implied the problem was with the receive.
Last edited by simon.starkie on Thu Apr 10, 2003 1:35 pm; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 10, 2003 1:34 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, again, you can only get from a queue that is local to the queue manager you are connected to.
So the verbiage was right, you were trying to get from a non-local queue.
But what you were doing would work if your input connection was connected to the other queue manager.
You can put to remote queues through a number of circumstances - remote definitions, clusters, etc. |
|
Back to top |
|
 |
simon.starkie |
Posted: Thu Apr 10, 2003 1:39 pm Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
No, it failed on the SEND. But my guess is that JMS tries to read or browse the object as part of the SEND function, hence the error. The verbage of the massage is not clear in this respect. But I think my experience with this issue may be beneficial to someone else later on. Thanks for your help. Cheers!  |
|
Back to top |
|
 |
|