Author |
Message
|
joesatch |
Posted: Tue Aug 03, 2010 6:57 am Post subject: get 2035 on connecting to the base queue |
|
|
Newbie
Joined: 03 Aug 2010 Posts: 5
|
Hi all,
I am running a simple Java client to connect to a remote MQ queue.
1. When I run the Java code to read write messages with Alias queue name, it works fine.
2. When i try to run the code on the same queue but witha a physical queue name (Because i wish to invoke getQueueDepth), I get a 2035 error at the point when the code tries to establish a connection
The authority on the queue are:
browse +dsp +get +inq +put +set +setall
The java code is as under
------------------------------------------------------------------------------------
import com.ibm.mq.MQC;
import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQGetMessageOptions;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
public class MQSniffer {
/**
* @param args
*/
/**
* @param args
*/
public static void main(String[] args) {
String hostname = "XXXX";
String channel = "CHANNEL";
String qManager = "qmgr";
MQQueueManager qMgr;
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
try {
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_OUTPUT ;
//***************Get an exception on the line below************//
MQQueue system_default_local_queue =
qMgr.accessQueue("PHYSICAL_QUEUE_NAME",
openOptions,
null,
null,
null);
System.out.println("****Current Depth is "+ system_default_local_queue.getCurrentDepth());
MQMessage hello_world = new MQMessage();
hello_world.writeUTF("Hello World!");
MQPutMessageOptions pmo = new MQPutMessageOptions();
system_default_local_queue.put(hello_world,pmo);
System.out.println("Put the message");
system_default_local_queue.close();
// Disconnect from the queue manager
qMgr.disconnect();
}
catch (MQException ex)
{
System.out.println("An MQSeries error occurred : Completion code " +
ex.completionCode +
" Reason code " + ex.reasonCode);
ex.printStackTrace();
}
catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer: " + ex);
}
}
}
------------------------------------------------------------------------------------
om.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2035
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2858)
at org.ku.benchmarkos.MQSniffer.main(MQSniffer.java)
Any help is appreciated!
Thanks
J |
|
Back to top |
|
 |
joesatch |
Posted: Tue Aug 03, 2010 7:26 am Post subject: |
|
|
Newbie
Joined: 03 Aug 2010 Posts: 5
|
sorry - Forgot to add. I know that 2-35 is permissions issue. But wht i cannot understand is:
1. I can read/write off the queues fine when i use an Alias instead of the base/physical queue name.
2. The permissions are already set to "browse +dsp +get +inq +put +set +setall". Am at a loss as to wht other permission should be there. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 03, 2010 7:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
joesatch wrote: |
1. I can read/write off the queues fine when i use an Alias instead of the base/physical queue name. |
That's because the alias queue will have separate permissions to the base queue.
joesatch wrote: |
2. The permissions are already set to "browse +dsp +get +inq +put +set +setall". Am at a loss as to wht other permission should be there. |
Check which queue has which permissions.
As an aside, there's almost never a good reason for a normal application to be obtaining queue depth. There's also almost never a good reason to write a queue depth monitoring application when so many are available.
Both these last points have been discussed many times in here. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
joesatch |
Posted: Tue Aug 03, 2010 8:05 am Post subject: |
|
|
Newbie
Joined: 03 Aug 2010 Posts: 5
|
Hi Vitor,
>That's because the alias queue will have separate permissions to the base queue.
I have just asked my admin to check that.
>As an aside, there's almost never a good reason for a normal application to be obtaining queue depth. There's also almost never a good reason to write a queue depth monitoring application when so many are available.
My app is not trying to obtain the queue depth and other attributes. I have been trying to use various tools to monitor the queues. But have been struggling with 2035. This morning, to gain a better insight of whts happening, I stated writing my own client.
I have tried MQTool avaialble on sourfceforge and also IBM's SupportPac MA96. Are there any better open source options available?
Many Thanks
J |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 03, 2010 8:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
joesatch wrote: |
My app is not trying to obtain the queue depth and other attributes. |
Ah - I was confused by your original post which said:
joesatch wrote: |
When i try to run the code on the same queue but witha a physical queue name (Because i wish to invoke getQueueDepth) |
I mistakenly assumed you were invoking getQueueDepth to get the queue depth.
joesatch wrote: |
I have been trying to use various tools to monitor the queues....I have tried MQTool avaialble on sourfceforge and also IBM's SupportPac MA96. Are there any better open source options available? |
If by "monitoring" you mean "examine the test messages I'm putting on it" then RFHUtil, q or some of the other support pacs might serve your need.
If by "monitoring" you mean "monitoring" leave it to the MQ admin. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
joesatch |
Posted: Tue Aug 03, 2010 8:54 am Post subject: |
|
|
Newbie
Joined: 03 Aug 2010 Posts: 5
|
Just checked with my admin - Only admins have inq and other rights on the base queue. So yeh, thats the problem.
I think RFHUtil is the tool for me. Just downloaded it. Looks great!
Thanks for you kind help Mate.
Cheers!
J |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 03, 2010 8:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
joesatch wrote: |
I think RFHUtil is the tool for me. Just downloaded it. Looks great! |
I like it. As you sound like a newbie I'll point out it comes in 2 flavours - RFHUtil & RFHUtilc which connect to a queue manager in 2 different ways. You may or may not find this information useful. Either way, enjoy.
joesatch wrote: |
Thanks for you kind help Mate. |
One of the reasons I hang round in here.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 03, 2010 8:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
joesatch wrote: |
I am running a simple Java client to connect to a remote MQ queue.
1. When I run the Java code to read write messages with Alias queue name, it works fine.
2. When i try to run the code on the same queue but witha a physical queue name (Because i wish to invoke getQueueDepth), I get a 2035 error at the point when the code tries to establish a connection
|
As you are a newbie let me add some additional information:
- A remote Queue has no depth
- The xmitq underlying the remote queue has completely different permissions from the remote queue
- If the channel is triggered and there is no communication problems or consumption problems at the other end, you'll be hard put to find a queue depth to the channel's xmitq.
May I suggest you read the intercommunications manual.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
joesatch |
Posted: Wed Aug 04, 2010 1:01 am Post subject: |
|
|
Newbie
Joined: 03 Aug 2010 Posts: 5
|
>May I suggest you read the intercommunications manual.
Yep, looks like the way to go. Aint no way but the hard way, so get used to it
>I like it. As you sound like a newbie I'll point out it comes in 2 flavours - RFHUtil & RFHUtilc which connect to a queue manager in 2 different ways. You may or may not find this information useful. Either way, enjoy.
Any info is useful info - atleast for a newbie
Cheers guys!
-J |
|
Back to top |
|
 |
|