|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Exclusively Read Message from the MQ Queue using JMS |
« View previous topic :: View next topic » |
Author |
Message
|
ravi_sri24 |
Posted: Fri Jun 29, 2007 3:04 am Post subject: Exclusively Read Message from the MQ Queue using JMS |
|
|
Voyager
Joined: 11 May 2006 Posts: 83
|
Hi,
//Start the connection
qConnection.start();
System.out.println("Connection Started\n");
session = qConnection.createQueueSession(boTransacted, Session.AUTO_ACKNOWLEDGE);
//Create queue object
queue = session.createQueue("in");
qsender = session.createSender(queue);
queueReceiver = session.createReceiver(queue);
System.out.println("Connection Started\n");
here am uisng the Queue name is 'in' my application only want to exclusively read messages from this queue
where should i mention the properties for this, is any body having the idea a bout how to read exclusively messages from queue using JMS
Thanks in advance for Help |
|
Back to top |
|
 |
mehedi |
Posted: Fri Jun 29, 2007 6:24 am Post subject: Open Input exclusive option (MQC.MQOO_INPUT_EXCLUSIVE ) |
|
|
Centurion
Joined: 11 Nov 2001 Posts: 102 Location: PSTech
|
Ravi ,
Use the open input exclusive option (MQC.MQOO_INPUT_EXCLUSIVE ) when creating the queue object.
The list of options from the Using Java manual
MQQueue
public MQQueue(MQQueueManager qMgr, String queueName, int openOptions,
String queueManagerName,
String dynamicQueueName, String alternateUserId)
throws MQException;
Public constructor which allows users to create MQQueue subclasses.
Parameters
qMgr - the object which represents the queue manager on which the queue resides. Valid options are:
MQC.MQOO_ALTERNATE_USER_AUTHORITY
MQC.MQOO_BIND_AS_Q_DEF
MQC.MQOO_BIND_NOT_FIXED
MQC.MQOO_BIND_ON_OPEN
MQC.MQOO_BROWSE
MQC.MQOO_FAIL_IF_QUIESCING
MQC.MQOO_INPUT_AS_Q_DEF
MQC.MQOO_INPUT_SHARED
MQC.MQOO_INPUT_EXCLUSIVE
MQC.MQOO_INQUIRE
MQC.MQOO_OUTPUT
MQC.MQOO_PASS_ALL_CONTEXT
MQC.MQOO_PASS_IDENTITY_CONTEXT
MQC.MQOO_SAVE_ALL_CONTEXT
MQC.MQOO_SET
MQC.MQOO_SET_ALL_CONTEXT
MQC.MQOO_SET_IDENTITY_CONTEXT
MQC.MQOO_RESOLVE_LOCAL_Q |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 29, 2007 10:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to check what the option would be in URI form:
Session.createQueue("queue:///IN?<property>=<value>")
The using java manual might tell you how to set the right property and value. You could as well check out your options of doing this in JNDI. As a last resort you could create an alias with default open option exclusive and use that.
Enjoy  _________________ MQ & Broker admin |
|
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
|
|
|
|