Class Publisher
java.lang.Object
org.apache.jmeter.protocol.jms.client.Publisher
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionPublisher(boolean useProps, String initialContextFactory, String providerUrl, String connfactory, String destinationName, boolean useAuth, String securityPrincipal, String securityCredentials) Create a publisher using either the jndi.properties file or the provided parameters.Publisher(boolean useProps, String initialContextFactory, String providerUrl, String connfactory, String destinationName, boolean useAuth, String securityPrincipal, String securityCredentials, boolean staticDestination) Create a publisher using either the jndi.properties file or the provided parameters -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close will close the sessionMessagepublish(byte[] bytes, String destinationName, Map<String, Object> properties, int deliveryMode, int priority, long expiration) Messagepublish(Serializable contents, String destinationName, Map<String, Object> properties, int deliveryMode, int priority, long expiration) Messagepublish(String text, String destinationName, Map<String, Object> properties, int deliveryMode, int priority, long expiration) MapMessagepublish(Map<String, Object> map, String destinationName, Map<String, Object> properties, int deliveryMode, int priority, long expiration)
-
Constructor Details
-
Publisher
public Publisher(boolean useProps, String initialContextFactory, String providerUrl, String connfactory, String destinationName, boolean useAuth, String securityPrincipal, String securityCredentials) throws JMSException, NamingException Create a publisher using either the jndi.properties file or the provided parameters. Uses a static destination and persistent messages(for backward compatibility)- Parameters:
useProps- true if a jndi.properties file is to be usedinitialContextFactory- the (ignored if useProps is true)providerUrl- (ignored if useProps is true)connfactory- name of the object factory to look up in contextdestinationName- name of the destination to useuseAuth- (ignored if useProps is true)securityPrincipal- (ignored if useProps is true)securityCredentials- (ignored if useProps is true)
-
Publisher
public Publisher(boolean useProps, String initialContextFactory, String providerUrl, String connfactory, String destinationName, boolean useAuth, String securityPrincipal, String securityCredentials, boolean staticDestination) throws JMSException, NamingException Create a publisher using either the jndi.properties file or the provided parameters- Parameters:
useProps- true if a jndi.properties file is to be usedinitialContextFactory- the (ignored if useProps is true)providerUrl- (ignored if useProps is true)connfactory- name of the object factory to lookup in contextdestinationName- name of the destination to useuseAuth- (ignored if useProps is true)securityPrincipal- (ignored if useProps is true)securityCredentials- (ignored if useProps is true)staticDestination- true if the destination is not to change between loops
-
-
Method Details
-
publish
public Message publish(String text, String destinationName, Map<String, Object> properties, int deliveryMode, int priority, long expiration) throws JMSException, NamingException- Throws:
JMSExceptionNamingException
-
publish
public Message publish(Serializable contents, String destinationName, Map<String, Object> properties, int deliveryMode, int priority, long expiration) throws JMSException, NamingException- Throws:
JMSExceptionNamingException
-
publish
public Message publish(byte[] bytes, String destinationName, Map<String, Object> properties, int deliveryMode, int priority, long expiration) throws JMSException, NamingException- Throws:
JMSExceptionNamingException
-
publish
public MapMessage publish(Map<String, Object> map, String destinationName, Map<String, throws JMSException, NamingExceptionObject> properties, int deliveryMode, int priority, long expiration) - Throws:
JMSExceptionNamingException
-
close
public void close()Close will close the session- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-