Author |
Message
|
sbuster |
Posted: Wed Sep 26, 2012 8:36 am Post subject: MQ Series and Hermes + Remote Queue |
|
|
Apprentice
Joined: 07 Oct 2008 Posts: 25
|
I'm trying to connect Hermes to a remote queue definition which only allows PUT, not ready. Based on the MQ error (com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2045'.
) I think it is trying to do a read. Does anyone know what value to set to make this read only?
For example, on the MQConnectionOptions of the MQQueueConnectionFactory is there a specific value I should put in?
Thanks |
|
Back to top |
|
 |
vmcgloin |
Posted: Wed Sep 26, 2012 1:56 pm Post subject: |
|
|
Knight
Joined: 04 Apr 2002 Posts: 560 Location: Scotland
|
Restrict your open options to output only. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 26, 2012 8:23 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
vmcgloin wrote: |
Restrict your open options to output only. |
You're not setting the options in JMS.
More likely he is trying to do a browse or a read  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sbuster |
Posted: Thu Sep 27, 2012 5:29 am Post subject: |
|
|
Apprentice
Joined: 07 Oct 2008 Posts: 25
|
I understand what I'm doing wrong, my question was HOW to make this read only? A person can get lost pretty quick in all the "options" when opening a queue. |
|
Back to top |
|
 |
exerk |
Posted: Thu Sep 27, 2012 6:02 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
sbuster wrote: |
I understand what I'm doing wrong, my question was HOW to make this read only? |
Only open the queue for OUTPUT - simples! _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
sbuster |
Posted: Thu Sep 27, 2012 7:56 am Post subject: |
|
|
Apprentice
Joined: 07 Oct 2008 Posts: 25
|
Bad choice of words, I do not want to open it up as read only.
Here is the piece of code I believe I need help with.
MQConnectionFactory cf = new MQConnectionFactory();
int openOptions = ???
cf.setMQConnectionOptions(openOptions);
What options do I use for openOptions?????
And further more, is this hte same option for JMS classes? |
|
Back to top |
|
 |
exerk |
Posted: Thu Sep 27, 2012 8:08 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
You open a QREMOTE for OUTPUT only, there is no other option, the following being from one of the IBM java samples:
Code: |
// Create a connection to the QueueManager
MQQueueManager qMgr = new MQQueueManager(qManager, qCCDT);
// Set up the options on the queue we wish to open
int openOptions = MQConstants.MQOO_OUTPUT;
// Now specify the queue that we wish to open and the open options
MQQueue queue = qMgr.accessQueue(qQueue, openOptions);
// Define a simple WebSphere MQ Message and write some text in UTF8 format
MQMessage msg = new MQMessage();
// Specify the default put message options
MQPutMessageOptions pmo = new MQPutMessageOptions();
// Put the message to the queue
queue.put(msg, pmo); |
From the above, and with the Application Programming Guide, you should be able to work out the requirements. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
sbuster |
Posted: Thu Sep 27, 2012 8:24 am Post subject: |
|
|
Apprentice
Joined: 07 Oct 2008 Posts: 25
|
Thanks, do you have a sample for JMS based classes? I can't find one and when I use the value you have provided I get the following error.
int openOptions = MQConstants.MQOO_OUTPUT;
cf.setMQConnectionOptions(openOptions);
Exception in thread "main" com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ1006: The value '16' for property 'Invalid connection options when in client mode' is not valid. The value specified for the property is not supported. Modify the value to be within the range of accepted values.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) |
|
Back to top |
|
 |
exerk |
Posted: Thu Sep 27, 2012 8:43 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Have a look in the tools/jms/samples directory of your installation, assuming you have installed that component on your test infrastructure. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
|