|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
2085 while putting messages to a cluster queue |
« View previous topic :: View next topic » |
Author |
Message
|
inblue |
Posted: Wed Aug 10, 2005 4:19 am Post subject: 2085 while putting messages to a cluster queue |
|
|
Newbie
Joined: 28 Oct 2003 Posts: 3
|
I have a cluster (TEST) which has 3 QMgrs QMA,QMB,QMC.
QMB is the full repository and i have a local Q L1 on QMC that is shared in the cluster
Now, logically my java application should be able to put a message to L1 by connecting to QMA even though L1 physically resides on QMC.
However, while running the java application ( ie connecting it to QMA and putting to L1 ),I get a 2085 error. i.e Object unknown.
The java code is as below
Code: |
import java.util.*;
import java.io.*;
import com.ibm.mq.*;
public class MQSeriesClientput {
static String HostName = "x.x.x.x";
private static String qmanager = "QMA";
private static String qchannel = "SYSTEM.DEF.SVRCONN";
private static String qname = "L1";
public static void main(String[] args){
//Step 1. Connect Application to the Queue Manager
try {
MQEnvironment env = new MQEnvironment();
env.hostname = HostName; // Could have put the hostname & channel
env.channel = qchannel; // string directly here!
env.port = 1000;
MQQueueManager qmgr = new MQQueueManager(qmanager);
int openOptions = MQC.MQOO_OUTPUT |MQC.MQOO_BIND_ON_OPEN ;
//Step 2. Open a Queue for output
MQQueue myq = qmgr.accessQueue( qname,
openOptions,
qmanager,
null,
null );
//Step 3. Put message into the queue
MQMessage mymsg = new MQMessage();
mymsg.messageId = null;
mymsg.correlationId = null;
mymsg.format = MQC.MQFMT_STRING;
String sendToMQ = "Test Message!";
mymsg.writeString( sendToMQ );
myq.put(mymsg);
System.out.println("Your job has been submitted ..."+"\n");
//Step 4. Close the Queue
myq.close();
//Step 5. Disconnect the Queue
qmgr.disconnect();
} catch(MQException mx) {
System.out.println( mx);
mx.printStackTrace();}
catch(IOException Ix) {
System.out.println( Ix);
Ix.printStackTrace();}
}
}
|
More so , when i use amqsput to write messages using the following command, it works, although i am connecting to QMA where L1 does not reside physically.
The output from the amqusput is
Quote: |
C:\Program Files\MQSeries\tools\c\samples\bin>amqsput L1 QMA
Sample AMQSPUT0 start
target queue is L1
test
Sample AMQSPUT0 end
|
Now, if i alter the accessqueue function as below
Code: |
MQQueue myq = qmgr.accessQueue( qname,
openOptions,
"QMC",
null,
null );
|
That is, specify the name of the residing queuemanager while accessing the queue, i am successfully able to put the message to the cluster Q L1 although my application connected to QMA .
I do not understand why the code in the first case does not work.
I am wondering why put from amqsput is successful and it is not successful using the java code i specified in the first case.
Am i missing somethinng ?
Can anyone help me understand wht is the reason for this discrepancy
Thanks |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Aug 10, 2005 4:21 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
if you do the open with qname and lokal qmgrname, mq looks for a local defined queue, it does not check the cluster. use a blank queuemanagername when opening the queue and it will work. _________________ Regards, Butcher |
|
Back to top |
|
 |
happyj |
Posted: Wed Aug 10, 2005 5:17 am Post subject: |
|
|
Voyager
Joined: 07 Feb 2005 Posts: 87
|
chapter 8 of the application programming guide goes into
how MQOPEN works in detail.
Also look at MQOO_BIND_NOT_FIXED and MQ_OO_BIND_ON_OPEN
you might want to look at local alias queues to the remote Q |
|
Back to top |
|
 |
EddieA |
Posted: Wed Aug 10, 2005 9:16 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
you might want to look at local alias queues to the remote Q |
Why. This is using a Cluster.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
inblue |
Posted: Wed Aug 10, 2005 7:54 pm Post subject: |
|
|
Newbie
Joined: 28 Oct 2003 Posts: 3
|
hey Butcher, specfying a blank queuemanager name while opening the queue did it.
thanks for the help |
|
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
|
|
|
|