org.apache.jmeter.protocol.jms.client

## Class Publisher

- java.lang.Object
- - org.apache.jmeter.protocol.jms.client.Publisher

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      public class Publisher
      extends java.lang.Object
      implements java.io.Closeable

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Publisher(boolean useProps, java.lang.String initialContextFactory, java.lang.String providerUrl, java.lang.String connfactory, java.lang.String destinationName, boolean useAuth, java.lang.String securityPrincipal, java.lang.String securityCredentials)` Create a publisher using either the jndi.properties file or the provided parameters.
    `Publisher(boolean useProps, java.lang.String initialContextFactory, java.lang.String providerUrl, java.lang.String connfactory, java.lang.String destinationName, boolean useAuth, java.lang.String securityPrincipal, java.lang.String securityCredentials, boolean staticDestination)` Create a publisher using either the jndi.properties file or the provided parameters

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close will close the session
    `javax.jms.Message` | `publish(byte[] bytes, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration)`
    `javax.jms.MapMessage` | `publish(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration)`
    `javax.jms.Message` | `publish(java.io.Serializable contents, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration)`
    `javax.jms.Message` | `publish(java.lang.String text, java.lang.String destinationName, java.util.Map<java.lang.String,java.lang.Object> properties, int deliveryMode, int priority, long expiration)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Publisher

          public Publisher(boolean useProps,
                           java.lang.String initialContextFactory,
                           java.lang.String providerUrl,
                           java.lang.String connfactory,
                           java.lang.String destinationName,
                           boolean useAuth,
                           java.lang.String securityPrincipal,
                           java.lang.String securityCredentials)
                    throws javax.jms.JMSException,
                           javax.naming.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 used
        `initialContextFactory` - the (ignored if useProps is true)
        `providerUrl` - (ignored if useProps is true)
        `connfactory` - name of the object factory to look up in context
        `destinationName` - name of the destination to use
        `useAuth` - (ignored if useProps is true)
        `securityPrincipal` - (ignored if useProps is true)
        `securityCredentials` - (ignored if useProps is true)
      Throws:
        `javax.jms.JMSException` - if the context could not be initialised, or there was some other error
        `javax.naming.NamingException` - when creation of the publisher fails

    - #### Publisher

          public Publisher(boolean useProps,
                           java.lang.String initialContextFactory,
                           java.lang.String providerUrl,
                           java.lang.String connfactory,
                           java.lang.String destinationName,
                           boolean useAuth,
                           java.lang.String securityPrincipal,
                           java.lang.String securityCredentials,
                           boolean staticDestination)
                    throws javax.jms.JMSException,
                           javax.naming.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 used
        `initialContextFactory` - the (ignored if useProps is true)
        `providerUrl` - (ignored if useProps is true)
        `connfactory` - name of the object factory to lookup in context
        `destinationName` - name of the destination to use
        `useAuth` - (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
      Throws:
        `javax.jms.JMSException` - if the context could not be initialised, or there was some other error
        `javax.naming.NamingException` - when creation of the publisher fails

  - ### Method Detail

    - #### publish

          public javax.jms.Message publish(java.lang.String text,
                                           java.lang.String destinationName,
                                           java.util.Map<java.lang.String,java.lang.Object> properties,
                                           int deliveryMode,
                                           int priority,
                                           long expiration)
                                    throws javax.jms.JMSException,
                                           javax.naming.NamingException

      Throws:
        `javax.jms.JMSException`
        `javax.naming.NamingException`

    - #### publish

          public javax.jms.Message publish(java.io.Serializable contents,
                                           java.lang.String destinationName,
                                           java.util.Map<java.lang.String,java.lang.Object> properties,
                                           int deliveryMode,
                                           int priority,
                                           long expiration)
                                    throws javax.jms.JMSException,
                                           javax.naming.NamingException

      Throws:
        `javax.jms.JMSException`
        `javax.naming.NamingException`

    - #### publish

          public javax.jms.Message publish(byte[] bytes,
                                           java.lang.String destinationName,
                                           java.util.Map<java.lang.String,java.lang.Object> properties,
                                           int deliveryMode,
                                           int priority,
                                           long expiration)
                                    throws javax.jms.JMSException,
                                           javax.naming.NamingException

      Throws:
        `javax.jms.JMSException`
        `javax.naming.NamingException`

    - #### publish

          public javax.jms.MapMessage publish(java.util.Map<java.lang.String,java.lang.Object> map,
                                              java.lang.String destinationName,
                                              java.util.Map<java.lang.String,java.lang.Object> properties,
                                              int deliveryMode,
                                              int priority,
                                              long expiration)
                                       throws javax.jms.JMSException,
                                              javax.naming.NamingException

      Throws:
        `javax.jms.JMSException`
        `javax.naming.NamingException`

    - #### close

          public void close()

      Close will close the session
      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.