org.apache.jmeter.protocol.jms.client
public class ReceiveSubscriber extends Object implements Closeable, javax.jms.MessageListener
getMessage(long)
method is used to return the next message,
either directly using receive(timeout) or from the queue using poll(timeout).Constructor and Description |
---|
ReceiveSubscriber(boolean useProps,
String initialContextFactory,
String providerUrl,
String connfactory,
String destinationName,
String durableSubscriptionId,
boolean useAuth,
String securityPrincipal,
String securityCredentials)
Constructor takes the necessary JNDI related parameters to create a
connection and prepare to begin receiving messages.
|
ReceiveSubscriber(int queueSize,
boolean useProps,
String initialContextFactory,
String providerUrl,
String connfactory,
String destinationName,
String durableSubscriptionId,
boolean useAuth,
String securityPrincipal,
String securityCredentials)
Constructor takes the necessary JNDI related parameters to create a
connection and create an onMessageListener to prepare to begin receiving messages.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
close() will stop the connection first.
|
javax.jms.Message |
getMessage(long timeout)
Get the next message or null.
|
void |
onMessage(javax.jms.Message message) |
void |
start()
Calls Connection.start() to begin receiving inbound messages.
|
void |
stop()
Calls Connection.stop() to stop receiving inbound messages.
|
public ReceiveSubscriber(boolean useProps, String initialContextFactory, String providerUrl, String connfactory, String destinationName, String durableSubscriptionId, boolean useAuth, String securityPrincipal, String securityCredentials) throws NamingException, javax.jms.JMSException
start()
to enable message reception.useProps
- if true, use jndi.properties instead of
initialContextFactory, providerUrl, securityPrincipal, securityCredentialsinitialContextFactory
- providerUrl
- connfactory
- destinationName
- useAuth
- securityPrincipal
- securityCredentials
- javax.jms.JMSException
- if could not create context or other problem occurred.NamingException
public ReceiveSubscriber(int queueSize, boolean useProps, String initialContextFactory, String providerUrl, String connfactory, String destinationName, String durableSubscriptionId, boolean useAuth, String securityPrincipal, String securityCredentials) throws NamingException, javax.jms.JMSException
start()
to enable message reception.queueSize
- maximum queue size <=0 == no limituseProps
- if true, use jndi.properties instead of
initialContextFactory, providerUrl, securityPrincipal, securityCredentialsinitialContextFactory
- providerUrl
- connfactory
- destinationName
- useAuth
- securityPrincipal
- securityCredentials
- javax.jms.JMSException
- if could not create context or other problem occurred.NamingException
public void start() throws javax.jms.JMSException
javax.jms.JMSException
public void stop() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message getMessage(long timeout) throws javax.jms.JMSException
timeout
- in millisecondsjavax.jms.JMSException
public void close()
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
Copyright © 1998-2014 Apache Software Foundation. All Rights Reserved.