public class JMSConsumer extends JMSClient
Modifier and Type | Field and Description |
---|---|
static int |
RECEIVEMODE_NOWAIT
The receive mode type where the consumer will not wait for a message to come and
will return immediately if it does not find any message.
|
static int |
RECEIVEMODE_WAIT
The receive mode type where the consumer will wait for a message to come till
it times out.
|
JMS_LOGGER, NO_TX, QUEUE, SESSION_TX, TOPIC
Constructor and Description |
---|
JMSConsumer(java.lang.String destinationName,
java.lang.String selector,
javax.jms.Session session,
java.util.Properties env) |
JMSConsumer(java.lang.String destinationName,
java.lang.String selector,
javax.jms.Session session,
java.lang.String subscriptionName,
java.util.Properties env) |
JMSConsumer(java.lang.String destinationName,
java.lang.String conFactoryName,
java.lang.String selector,
int txMode,
int receiveMode,
long waitTimeOut,
java.util.Properties env) |
JMSConsumer(java.lang.String destinationName,
java.lang.String conFactoryName,
java.lang.String selector,
int txMode,
int receiveMode,
long waitTimeOut,
java.util.Properties env,
java.lang.String providerUserName,
java.lang.String providerPassword) |
JMSConsumer(java.lang.String destinationName,
java.lang.String conFactoryName,
java.lang.String selector,
int txMode,
java.util.Properties env) |
JMSConsumer(java.lang.String destinationName,
java.lang.String conFactoryName,
java.lang.String selector,
int txMode,
java.util.Properties env,
java.lang.String providerUserName,
java.lang.String providerPassword) |
JMSConsumer(java.lang.String destinationName,
java.lang.String conFactoryName,
java.lang.String selector,
int txMode,
java.lang.String subscriptionName,
java.util.Properties env) |
JMSConsumer(java.lang.String destinationName,
java.lang.String conFactoryName,
java.lang.String selector,
int txMode,
java.lang.String subscriptionName,
java.util.Properties env,
java.lang.String providerUserName,
java.lang.String providerPassword) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releses all resources that is cached by the client like JMS Session and
Connection.
|
JMSClient |
createClientInSession()
Creates another JMSClient of the same type in this clients Session.
|
JMSClient |
createClientInSession(java.lang.String destinationName,
java.util.Properties env)
Creates another JMSClient of the same type in this clients Session.
|
JMSProducer |
createJMSProducerInSession()
Creates a
JMSProducer in the same Session. |
JMSData |
getMessage(boolean autocommit)
Get a message from the Queue matching the selection criterion [if a message selector
is specified].
|
commitTx, getDestinationName, getEnvironment, getProviderPassword, getProviderUserName, getSession, isValid, rollbackTx
public static final int RECEIVEMODE_NOWAIT
public static final int RECEIVEMODE_WAIT
public JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.selector
- The message selector for the MessageConsumer.txMode
- The transaction mode for the JMS client Session.env
- The env properties to create an InitialContext.MXException
public JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.selector
- The message selector for the MessageConsumer.txMode
- The transaction mode for the JMS client Session.env
- The env properties to create an InitialContext.providerUserName
- The provider connection user.providerPassword
- The provider connection password.MXException
public JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, int receiveMode, long waitTimeOut, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.selector
- The message selector for the MessageConsumer.txMode
- The transaction mode for the JMS client Session.receiveMode
- The default receive mode is RECEIVEMODE_NOWAIT.waitTimeOut
- The wait timeout in milliseconds.env
- The env properties to create an InitialContext.MXException
public JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, int receiveMode, long waitTimeOut, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.selector
- The message selector for the MessageConsumer.txMode
- The transaction mode for the JMS client Session.receiveMode
- The default receive mode is RECEIVEMODE_NOWAIT.waitTimeOut
- The wait timeout in milliseconds.env
- The env properties to create an InitialContext.providerUserName
- The provider connection user.providerPassword
- The provider connection password.MXException
public JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.lang.String subscriptionName, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.selector
- The message selector for the MessageConsumer.txMode
- The transaction mode for the JMS client Session.subscriptionName
- The subscription name in case of subscribing to a Topic.env
- The env properties to create an InitialContext.providerUserName
- The provider connection user.providerPassword
- The provider connection password.MXException
public JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.lang.String subscriptionName, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.selector
- The message selector for the MessageConsumer.txMode
- The transaction mode for the JMS client Session.subscriptionName
- The subscription name in case of subscribing to a Topic.env
- The env properties to create an InitialContext.MXException
public JMSConsumer(java.lang.String destinationName, java.lang.String selector, javax.jms.Session session, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.selector
- The message selector for the MessageConsumer.session
- the JMS session from which the client should be created.env
- The env properties to create an InitialContext.MXException
public JMSConsumer(java.lang.String destinationName, java.lang.String selector, javax.jms.Session session, java.lang.String subscriptionName, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.selector
- The message selector for the MessageConsumer.session
- the JMS session from which the client should be created.subscriptionName
- The subscription name in case of subscribing to a Topic.env
- The env properties to create an InitialContext.MXException
public JMSData getMessage(boolean autocommit) throws MXException
autocommit
- If set to true will commit the transaction if invoked in the context
of a JMS Session transaction.
See txMode
for more details.MXException
public void close()
JMSClient
public JMSClient createClientInSession() throws MXException
JMSClient
createClientInSession
in class JMSClient
MXException
public JMSClient createClientInSession(java.lang.String destinationName, java.util.Properties env) throws MXException
JMSClient
createClientInSession
in class JMSClient
MXException
public JMSProducer createJMSProducerInSession() throws MXException
JMSProducer
in the same Session.MXException