:plugin: jms
:type: input
:default_codec: plain

///////////////////////////////////////////
START - GENERATED VARIABLES, DO NOT EDIT!
///////////////////////////////////////////
:version: %VERSION%
:release_date: %RELEASE_DATE%
:changelog_url: %CHANGELOG_URL%
:include_path: ../../../../logstash/docs/include
///////////////////////////////////////////
END - GENERATED VARIABLES, DO NOT EDIT!
///////////////////////////////////////////

[id="plugins-{type}s-{plugin}"]

=== Jms input plugin

include::{include_path}/plugin_header.asciidoc[]

==== Description

Read events from a Jms Broker. Supports both Jms Queues and Topics.

For more information about Jms, see <https://javaee.github.io/tutorial/jms-concepts.html>.
For more information about the Ruby Gem used, see <http://github.com/reidmorrison/jruby-jms>.


JMS configurations can be done either entirely in the Logstash configuration file, or in a mixture of the Logstash
  configuration file, and a specified yaml file. Simple configurations that do not need to make calls to implementation
  specific methods on the connection factory can be specified entirely in the Logstash configuration, whereas more complex
  configurations, should also use the combination of yaml file and Logstash configuration.


[id="plugins-{type}s-{plugin}-ecs"]
==== Compatibility with the Elastic Common Schema (ECS)

JMS data is application specific. ECS compliance for fields depends on the use case.
The plugin includes sensible defaults that change based on <<plugins-{type}s-{plugin}-ecs_compatibility,ECS compatibility mode>>.
When ECS compatibility is disabled, headers, properties, and payload are targeted at the root level of the event to maintain compatibility with legacy usage of this plugin.
When targeting an ECS version, headers and properties target `@metadata` sub-fields unless configured otherwise in order to avoid conflict with ECS fields.
See <<plugins-{type}s-{plugin}-headers_target>>, <<plugins-{type}s-{plugin}-properties_target>> and <<plugins-{type}s-{plugin}-target>>.

==== Sample Configuration using Logstash Configuration Only

Configurations can be configured either entirely in Logstash configuration, or via a combination of Logstash configuration
and yaml file, which can be useful for sharing similar configurations across multiple inputs and outputs.
The JMS plugin can also be configured using JNDI if desired.

===== Logstash Confuguration for Non-JNDI Connection
[source,ruby]
--------------------------------------------------
 input
 {
    jms {
        broker_url => 'failover:(tcp://host1:61616,tcp://host2:61616)?initialReconnectDelay=100' <1>
        destination => 'myqueue' <2>
        factory => 'org.apache.activemq.ActiveMQConnectionFactory' <3>
        pub_sub => false <4>
        use_jms_timestamp => false <5>
        # JMS provider credentials if needed <6>
        username => 'username'
        password => 'secret'
        # JMS provider keystore and truststore details <7>
        keystore => '/Users/logstash-user/security/keystore.jks'
        keystore_password => 'another_secret'
        truststore => '/Users/logstash-user/security/truststore.jks'
        truststore_password => 'yet_another_secret'
        # Parts of the JMS message to be included <8>
        include_headers => false
        include_properties => false
        include_body => true
        # Message selector
        selector => "string_property = 'this' OR int_property < 3" <9>
        # Connection factory specific settings
        factory_settings => { <10>
                              exclusive_consumer => true
        }
        # Jar Files to include
        require_jars => ['/usr/share/jms/activemq-all-5.15.9.jar'] <11>
    }
  }
--------------------------------------------------

<1> Url of the broker to connect to. Please consult your JMS provider documentation for the exact syntax to use
    here, including how to enable failover.
<2> Name of the topic or queue that the plugin will listen to events from.
<3> Full name (including package name) of Java connection factory used to create a connection with your JMS provider.
<4> Determines whether the event source is a queue or a topic, set to `true` for topic, `false` for queue.
<5> Determines whether the JMSTimestamp header is used to populate the `@timestamp` field.
<6> Credentials to use when connecting to the JMS provider, if required.
<7> Keystore and Truststore to use when connecting to the JMS provider, if required.
<8> Parts of the JMS Message to include in the event - headers, properties and the message body can be included or
    excluded from the event.
<9> Message selector: Use this to filter messages to be processed. The whole selector query should be double-quoted,
    string property values should be single quoted, and numeric property vaues should not be quoted.
    See JMS provider documentation for exact syntax.
<10> Additional settings that are set directly on the ConnectionFactory object can be added here.
<11> List of jars required by the JMS provider. Paths should be the fully qualified location of all jar files required
     by the JMS provider. This list may also include dependent jars as well as specific jars from the JMS provider.

===== Logstash Configuration for JNDI Connection
[source,ruby]
--------------------------------------------------
 input {
    jms {
        # Logstash Configuration Settings. <1>
        include_headers => false
        include_properties => false
        include_body => true
        use_jms_timestamp => false
        destination => "myqueue"
        pub_sub => false
        # JNDI Settings
        jndi_name => /jms/cf/default <2>
        jndi_context => { <3>
         'java.naming.factory.initial' => com.solacesystems.jndi.SolJNDIInitialContextFactory
         'java.naming.security.principal' => solace-cloud-client@user
         'java.naming.provider.url' => tcp://address.messaging.solace.cloud:20608
         'java.naming.security.credentials' => verysecret
        }
        # Jar files to be imported
        require_jars=> ['/usr/share/jms/commons-lang-2.6.jar', <4>
                        '/usr/share/jms/sol-jms-10.5.0.jar',
                        '/usr/share/jms/geronimo-jms_1.1_spec-1.1.1.jar',
                        '/usr/share/jms/commons-lang-2.6.jar]'
    }
 }
--------------------------------------------------

<1> Configuration settings. Note that there is no `broker_url` or `username` or `password` defined here - these are
    defined in the `jndi_context` hash.
<2> JNDI name for this connection.
<3> JNDI context settings hash. Contains details of how to connect to JNDI server. See your JMS provider documentation for
     implementation specific details.
<4> List of jars required by the JMS provider. Paths should be the fully qualified location of all jar files required
     by the JMS provider. This list may also include dependent jars as well as specific jars from the JMS provider.


==== Sample Configuration using Logstash Configuration and Yaml File

===== Non-JNDI Connection

This section contains sample configurations for connecting to a JMS provider that is not using JNDI using a combination
 of the Logstash configuration and the yaml file

===== Logstash Configuration for Non-JNDI Connection (for configs including yaml)

[source,ruby]
--------------------------------------------------
 input {
    jms {
        # Logstash Configuration File Settings <1>
        include_headers => false
        include_properties => false
        include_body => true
        use_jms_timestamp => false
        destination => "myqueue"
        pub_sub => false
        # JMS Provider credentials <2>
        username => xxxx
        password => xxxx
        # Location of yaml file, and which section to use for configuration
        yaml_file => "~/jms.yml"  <3>
        yaml_section => "mybroker" <4>
    }
 }
--------------------------------------------------


<1> Configuration settings
<2> Username and password for the connection.
<3> Full path to a yaml file containing the definition for the ConnectionFactory.
<4> Section name in the yaml file of the ConnectionFactory for this plugin definition


===== Yaml File for Non-JNDI Connection

[source,yaml]
--------------------------------------------------
mybroker: <1>
  :broker_url: 'ssl://localhost:61617' <2>
  :factory: org.apache.activemq.ActiveMQConnectionFactory <3>
  :exclusive_consumer: true <4>
  :require_jars: <5>
    - /usr/share/jms/activemq-all-5.15.9.jar
    - /usr/share/jms/log4j-1.2.17.jar
--------------------------------------------------

<1> Section name for this broker definition. This should be the value of `yaml_section` in the logstash configuration file.
    Note that multiple sections can co-exist in the same yaml file.
<2> Full url of the broker. See your JMS Provider documentation for details.
<3> Full name (including package name) of Java connection factory used to create a connection with your JMS provider.
<4> Implementation specific configuration parameters to be used with the connection factory specified.
    in <3>. Each JMS Provider will have its own set of parameters that can be used here. These parameters are mapped to
    `set` methods on the provided connection factory, and can be supplied in either 'snake' or 'camel' case. In <4> above,
    the `exclusive_consumer` property will call the `setExclusiveConsumer` on the supplied connection factory. See your JMS provider
   documentation for implementation specific details.
<5> List of jars required by the JMS provider. Paths should be the fully qualified location of all jar files required
    by the JMS provider. This list may also include dependent jars as well as specific jars from the JMS provider.


===== JNDI Connection

This section contains sample configurations for connecting to a JMS provider that is using JNDI using a combination
 of the Logstash configuration and the yaml file

===== Logstash Configuration for JNDI Connection (for configs including yaml)

[source,ruby]
--------------------------------------------------
 input {
    jms {
        # Logstash specific configuration settings <1>
        include_headers => false
        include_properties => false
        include_body => true
        use_jms_timestamp => false
        destination => "myqueue"
        pub_sub => false
        # Location of yaml file, and which section to use for configuration
        yaml_file => "~/jms.yml"  <2>
        yaml_section => "mybroker" <3>
    }
 }
--------------------------------------------------

<1> Configuration settings
<2> Full path to a yaml file containing the definition for the ConnectionFactory.
<3> Section name in the yaml file of the ConnectionFactory for this plugin definition


===== Yaml File for JNDI Connection

[source,yaml]
--------------------------------------------------

solace: <1>
  :jndi_name: /jms/cf/default <2>
  :jndi_context: <3>
    java.naming.factory.initial: com.solacesystems.jndi.SolJNDIInitialContextFactory
    java.naming.security.principal: solace-cloud-client@user
    java.naming.provider.url: tcp://address.messaging.solace.cloud:20608
    java.naming.security.credentials: verysecret
  :require_jars: <4>
    - /usr/share/jms/commons-lang-2.6.jar
    - /usr/share/jms/sol-jms-10.5.0.jar
    - /usr/share/jms/geronimo-jms_1.1_spec-1.1.1.jar
    - /usr/share/jms/commons-lang-2.6.jar
--------------------------------------------------

<1> Section name for this broker definition. This should be the value of `yaml_section` in the Logstash configuration file.
<2> Name of JNDI entry at which the Factory can be found
<3> JNDI context settings. Contains details of how to connect to JNDI server. See your JMS provider documentation for
     implementation specific details.
<4> List of jars required by the JMS provider. Paths should be the fully qualified location of all jar files required
     by the JMS provider. This list may also include dependent jars as well as specific jars from the JMS provider.


==== Jar files

In order to communicate with a JMS broker, the plugin must load the jar files necessary for each client type.
This can be set in the yaml file, or in the main configuration if a yaml file is not necessary. The `require_jars`
  setting should include the full path for each jar file required for the client. Eg

===== Logstash configuration

[source,ruby]
--------------------------------------------------

 input {
    jms {
              :
              [snip]
         require_jars => ['/usr/share/jms/commons-lang-2.6.jar',
                          '/usr/share/jms/sol-jms-10.5.0.jar',
                          '/usr/share/jms/geronimo-jms_1.1_spec-1.1.1.jar',
                          '/usr/share/jms/commons-lang-2.6.jar']
    }
 }
--------------------------------------------------

==== Troubleshooting

This section includes some common issues that a user may have when integrating this plugin with their JMS provider.

===== Missing Jar files

The most common issue is missing jar files, which may be jar files provided by the JMS vendor, or jar files that the JMS
 vendor requires to run. This issue can manifest in different ways, depending on where the missing jar file is discovered.

Example log output:

[source,txt]
-----
  Failed to load JMS Connection, likely because a JMS Provider is not on the Logstash classpath or correctly
  specified by the plugin's `require_jars` directive
  {:exception=>"cannot load Java class javax.jms.DeliveryMode"
-----

[source,txt]
-----
  JMS Consumer Died {:exception=>"Java::JavaxNaming::NoInitialContextException",
                     :exception_message=>"Cannot instantiate class:"
-----

[source,txt]
-----
  warning: thread "[main]<jms" terminated with exception (report_on_exception is true):
  java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableException
-----

[source,txt]
-----
  JMS Consumer Died {:exception=>"Java::JavaxJms::JMSException", :exception_message=>"io/netty/channel/epoll/Epoll",
  :root_cause=>{:exception=>"Java::JavaLang::NoClassDefFoundError", :exception_message=>"io/netty/channel/epoll/Epoll"}
-----

If any of these issues occur, check the list of `require_jars` in either the Logstash configuration or yaml configuration
  files.

===== Setting System Properties

Many JMS providers allow or expect System properties to be set to configure certain properties when using JMS, for
example, the Apache qpid JMS client allows the connection factory lookup to be stored there, and the Solace JMS client
allows many properties, such as number of connection retries to be set as System properties. Any system properties that
are set should be set in the Logstash `jvm.options` file.

===== Multiple JMS inputs/outputs in the same Logstash process

The use of multiple JMS consumers and producers in the same Logstash process is unsupported if:

  * System properties need to be different for any of the consumers/producers
  * Different keystores or truststores are required for any of the consumers/producers

===== Message Selectors unexpectedly filtering out all messages

Incorrect message selector syntax can have two effects - either the syntax is incorrect and the selector parser from the
JMS provider will throw an exception causing the plugin to fail OR the syntax will be accepted, but the messages will
be silently dropped - this can happen with incorrect quoting of string properties in the selector definition. All
selector definitions must be double quoted in the Logstash configuration file, and string property values must be
single quoted, and numeric property values not quoted at all.


===== Failed to create Event with MissingConverterException

Messages from certain JMS providers may contain headers or properties that Logstash cannot interpret, which can lead to
error messages such as:


[source,txt]
-----
[2019-11-25T08:04:28,769][ERROR][logstash.inputs.jms      ] Failed to create event {:message=>Java::ComSolacesystemsJmsMessage::SolTextMessage: ...
Attributes: {:jms_correlation_id=>"xxxx", :jms_delivery_mode_sym=>:non_persistent, :jms_destination=>"destination", :jms_expiration=>0, :jms_message_id=>"xxxxxx", :jms_priority=>0, :jms_redelivered=>false, :jms_reply_to=>#<Java::ComSolacesystemsJmsImpl::SolTopicImpl:0xdeadbeef>, :jms_timestamp=>1574669008862, :jms_type=>nil}
Properties: nil, :exception=>org.logstash.MissingConverterException: Missing Converter handling for full class name=com.solacesystems.jms.impl.SolTopicImpl, simple name=SolTopicImpl, :backtrace=>["org.logstash.Valuefier.fallbackConvert(Valuefier.java:98)..."]}
:exception=>org.logstash.MissingConverterException: Missing Converter handling for full class name=com.solacesystems.jms.impl.SolTopicImpl
-----

To get around this, use the `skip_headers` or `skip_properties` configuration setting to avoid attempting to process
the offending header or property in the message.

In the example shown above, this attribute is causing the
`MissingConverterException`:

`jms_reply_to=>#<Java::ComSolacesystemsJmsImpl::SolTopicImpl:0xdeadbeef>`


To avoid this error, the configuration should include the following line:

[source,ruby]
-----
skip_headers => ["jms_reply_to"]
-----


[id="plugins-{type}s-{plugin}-options"]
==== Jms Input Configuration Options

This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.

[cols="<,<,<",options="header",]
|=======================================================================
|Setting |Input type|Required
| <<plugins-{type}s-{plugin}-broker_url>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-destination>> |<<string,string>>|Yes
| <<plugins-{type}s-{plugin}-durable_subscriber>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-durable_subscriber_client_id>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-durable_subscriber_name>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-ecs_compatibility>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-factory>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-factory_settings>> |<<hash,hash>>|No
| <<plugins-{type}s-{plugin}-headers_target>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-include_body>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-include_header>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-include_headers>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-include_properties>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-interval>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-jndi_context>> |<<hash,hash>>|No
| <<plugins-{type}s-{plugin}-jndi_name>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-keystore>> |a valid filesystem path|No
| <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|No
| <<plugins-{type}s-{plugin}-oracle_aq_buffered_messages>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-password>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-properties_target>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-pub_sub>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-require_jars>> |<<array,array>>|No
| <<plugins-{type}s-{plugin}-runner>> |<<string,string>>|__Deprecated__
| <<plugins-{type}s-{plugin}-selector>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-skip_headers>> |<<array,array>>|No
| <<plugins-{type}s-{plugin}-skip_properties>> |<<array,array>>|No
| <<plugins-{type}s-{plugin}-system_properties>> |<<hash,hash>>|No
| <<plugins-{type}s-{plugin}-target>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-threads>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-timeout>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-truststore>> |a valid filesystem path|No
| <<plugins-{type}s-{plugin}-truststore_password>> |<<password,password>>|No
| <<plugins-{type}s-{plugin}-use_jms_timestamp>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-username>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-yaml_file>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-yaml_section>> |<<string,string>>|No
|=======================================================================

Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
input plugins.

&nbsp;

[id="plugins-{type}s-{plugin}-broker_url"]
===== `broker_url`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Url to use when connecting to the JMS provider. This is only relevant for non-JNDI configurations.

[id="plugins-{type}s-{plugin}-destination"]
===== `destination`

  * This is a required setting.
  * Value type is <<string,string>>
  * There is no default value for this setting.

Name of the destination queue or topic to use.

TIP: If the destination setting doesn't appear to be working properly, try this format: `<JMS module name>!<JMS queue name>`.

[id="plugins-{type}s-{plugin}-durable_subscriber"]
===== `durable_subscriber`

  * Value type is <<boolean,boolean>>
  * This is `false` by default
  * Requires `pub_sub` to be true

Setting this value to `true` will make subscriptions to topics "durable", which allowing messages that arrived on the
specified topic while Logstash is not running to still be read. Without setting this value, any messages sent to a topic
while Logstash is not actively listening will be lost. A durable subscriber specifies a unique identity consisting of the
 topic (`destination`), the client id (`durable_subscriber_client_id`) and subscriber name
 (`durable_subscriber_subscriber_name`). See your JMS Provider documentation for any further requirements/limitations
 around these settings.

* Note that a durable subscription can only have one active subscriber at a time.
* Note that this setting is only permitted when `pub_sub` is set to true, and will generate a configuration error otherwise

[id="plugins-{type}s-{plugin}-durable_subscriber_client_id"]
===== `durable_subscriber_client_id`

  * Value type is <<string,string>>
  * If `durable_subscriber` is set, the default value for this setting is 'Logstash', otherwise this setting has no
    effect

This represents the value of the client ID for a durable subscribtion, and is only used if `durable_subscriber` is set to `true`.

[id="plugins-{type}s-{plugin}-durable_subscriber_name"]
===== `durable_subscriber_name`

  * Value type is <<string,string>>
  * If `durable_subscriber` is set, the default value for this setting will be the same value as the `destination`
    setting, otherwise this setting has no effect.

This represents the value of the subscriber name for a durable subscribtion, and is only used if `durable_subscriber`
is set to `true`. Please consult your JMS Provider documentation for constraints and requirements for this setting.

[id="plugins-{type}s-{plugin}-ecs_compatibility"]
===== `ecs_compatibility`

  * Value type is <<string,string>>
  * Supported values are:
    ** `disabled`: does not use ECS-compatible field names (fields might be set at the root of the event)
    ** `v1`, `v8`: avoids field names that might conflict with Elastic Common Schema (for example, JMS specific properties)
  * Default value depends on which version of Logstash is running:
    ** When Logstash provides a `pipeline.ecs_compatibility` setting, its value is used as the default
    ** Otherwise, the default value is `disabled`.

Controls this plugin's compatibility with the {ecs-ref}[Elastic Common Schema (ECS)].
The value of this setting affects the _default_ value of <<plugins-{type}s-{plugin}-headers_target>> and
<<plugins-{type}s-{plugin}-properties_target>>.

[id="plugins-{type}s-{plugin}-factory"]
===== `factory`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Full name (including package name) of Java connection factory used to create a connection with your JMS provider.

[id="plugins-{type}s-{plugin}-factory_settings"]
===== `factory_settings`

  * Value type is <<hash,hash>>
  * There is no default value for this setting.

Hash of implementation specific configuration values to set on the connection factory of the JMS provider. Each JMS
 Provider will have its own set of parameters that can be used here. These parameters are mapped to `set` methods on
 the provided connection factory, and can be supplied in either 'snake' or 'camel' case. For example, a hash including
 `exclusive_consumer => true` would call `setExclusiveConsumer(true)` on the supplied connection factory.
 See your JMS provider documentation for implementation specific details.

[id="plugins-{type}s-{plugin}-headers_target"]
===== `headers_target`

  * Value type is <<string,string>>
  * Default value depends on whether <<plugins-{type}s-{plugin}-ecs_compatibility>> is enabled:
    ** ECS Compatibility disabled: no default value for this setting
    ** ECS Compatibility enabled: `"[@metadata][input][jms][headers]"

The name of the field under which JMS headers will be added, if <<plugins-{type}s-{plugin}-include_headers>> is set.

[id="plugins-{type}s-{plugin}-include_body"]
===== `include_body`

  * Value type is <<boolean,boolean>>
  * Default value is `true`

Include JMS Message Body in the event.
Supports TextMessage, MapMessage and BytesMessage.

If the JMS Message is a TextMessage or BytesMessage, then the value will be in
the "message" field of the event. If the JMS Message is a MapMessage, then all
the key/value pairs will be added at the top-level of the event by default.
To avoid pollution of the top-level namespace, when receiving a MapMessage, use the <<plugins-{type}s-{plugin}-target>>.

StreamMessage and ObjectMessage are not supported.

[id="plugins-{type}s-{plugin}-include_header"]
===== `include_header`

  * Value type is <<boolean,boolean>>
  * This option is deprecated

Note: This option is deprecated and it will be removed in the next major version of Logstash.
Use `include_headers` instead.

[id="plugins-{type}s-{plugin}-include_headers"]
===== `include_headers`

  * Value type is <<boolean,boolean>>
  * Default value is `true`

A JMS message has three parts:

  * Message Headers (required)
  * Message Properties (optional)
  * Message Body (optional)

You can tell the input plugin which parts should be included in the event produced by Logstash.

Include standard JMS message header field values in the event.
Example headers:
[source,ruby]
-----
    {
        "jms_message_id" => "ID:amqhost-39547-1636977297920-71:1:1:1:1",
        "jms_timestamp" => 1636977329102,
        "jms_expiration" => 0,
        "jms_delivery_mode" => "persistent",
        "jms_redelivered" => false,
        "jms_destination" => "topic://41ad5342149901ad",
        "jms_priority" => 4,
        "jms_type" => "sample",
        "jms_correlation_id" => "28d975cb-14ff-4285-841e-05ef1e0a7ab2"
    }
-----

[id="plugins-{type}s-{plugin}-include_properties"]
===== `include_properties`

  * Value type is <<boolean,boolean>>
  * Default value is `true`

Include JMS Message Properties Field values in the event.

[id="plugins-{type}s-{plugin}-interval"]
===== `interval`

  * Value type is <<number,number>>
  * Default value is `10`

Polling interval in seconds.
This is the time sleeping between asks to a consumed Queue.
This parameter has non influence in the case of a subcribed Topic.

[id="plugins-{type}s-{plugin}-jndi_context"]
===== `jndi_context`

  * Value type is <<hash,hash>>
  * There is no default value for this setting.

Only used if using JNDI lookup. Key value pairs to determine how to connect the JMS message brokers if JNDI
is being used. Consult your JMS provider documentation for the correct values to use here.


[id="plugins-{type}s-{plugin}-jndi_name"]
===== `jndi_name`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Only used if using JNDI lookup. Name of JNDI entry at which the Factory can be found.

[id="plugins-{type}s-{plugin}-keystore"]
===== `keystore`

  * Value type is <<path,path>>
  * There is no default value for this setting.

If you need to use a custom keystore (`.jks`) specify it here. This does not work with .pem keys

[id="plugins-{type}s-{plugin}-keystore_password"]
===== `keystore_password`

  * Value type is <<password,password>>
  * There is no default value for this setting.

Specify the keystore password here.
Note, most .jks files created with keytool require a password

[id="plugins-{type}s-{plugin}-oracle_aq_buffered_messages"]
===== `oracle_aq_buffered_messages`

  * Value type is <<boolean,boolean>>
  * Default value is `false`

Receive Oracle AQ buffered messages.
In this mode persistent Oracle AQ JMS messages will not be received.
Only for use with Oracle AQ

[id="plugins-{type}s-{plugin}-password"]
===== `password`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Password to use when connecting to the JMS provider.

[id="plugins-{type}s-{plugin}-properties_target"]
===== `properties_target`

  * Value type is <<string,string>>
  * Default value depends on whether <<plugins-{type}s-{plugin}-ecs_compatibility>> is enabled:
    ** ECS Compatibility disabled: no default value for this setting
    ** ECS Compatibility enabled: `"[@metadata][input][jms][properties]"

The name of the field under which JMS properties will be added, if <<plugins-{type}s-{plugin}-include_properties>> is set.

[id="plugins-{type}s-{plugin}-pub_sub"]
===== `pub_sub`

  * Value type is <<boolean,boolean>>
  * Default value is `false`

If pub-sub (topic) style should be used.  Note that if `pub_sub` is set to true, `threads` must be set to 1.

[id="plugins-{type}s-{plugin}-require_jars"]
===== `require_jars`

  * Value type is <<array,array>>
  * There is no default value for this setting.

If you do not use an yaml configuration use either the factory or jndi_name.
An optional array of Jar file names to load for the specified
JMS provider. By using this option it is not necessary
to put all the JMS Provider specific jar files into the
java CLASSPATH prior to starting Logstash.

[id="plugins-{type}s-{plugin}-runner"]
===== `runner`

  * DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.


[id="plugins-{type}s-{plugin}-selector"]
===== `selector`

  * Value type is <<string,string>>
  * There is no default value for this setting.

JMS message selector. Use in conjunctions with message headers or properties to filter messages to be processed. Only
messages that match the query specified here will be processed. Check with your JMS provider for the correct JMS message
selector syntax.

[id="plugins-{type}s-{plugin}-skip_headers"]
===== `skip_headers`

  * Value type is <<array,array>>
  * There is no default value for this setting.

If `include_headers` is set, a list of headers to skip processing on can be specified here.

[id="plugins-{type}s-{plugin}-skip_properties"]
===== `skip_properties`

  * Value type is <<array,array>>
  * There is no default value for this setting.

If `include_properties` is set, a list of properties to skip processing on can be specified here.

[id="plugins-{type}s-{plugin}-system_properties"]
===== `system_properties`

  * Value type is <<hash,hash>>
  * There is no default value for this setting.

Any System properties that the JMS provider requires can be set either in a Hash here, or in `jvm.options`

[id="plugins-{type}s-{plugin}-target"]
===== `target`

  * Value type is <<string,string>>
  * There is no default value for this setting.

The name of the field to assign MapMessage data into.
If not specified data will be stored in the root of the event.

NOTE: For TextMessage and BytesMessage the `target` has no effect. Use the codec setting instead
e.g. `codec => json { target => "[jms]" }`.

[id="plugins-{type}s-{plugin}-threads"]
===== `threads`

  * Value type is <<number,number>>
  * Default value is `1`

NOTE: If pub_sub is set to `true`, this value *must* be `1`. A configuration error will be thrown otherwise!

[id="plugins-{type}s-{plugin}-timeout"]
===== `timeout`

  * Value type is <<number,number>>
  * Default value is `60`

Initial connection timeout in seconds.

[id="plugins-{type}s-{plugin}-truststore"]
===== `truststore`

  * Value type is <<path,path>>
  * There is no default value for this setting.

If you need to use a custom truststore (`.jks`) specify it here. This does not work with .pem certs.

[id="plugins-{type}s-{plugin}-truststore_password"]
===== `truststore_password`

  * Value type is <<password,password>>
  * There is no default value for this setting.

Specify the truststore password here.

* Note, most .jks files created with keytool require a password.


[id="plugins-{type}s-{plugin}-use_jms_timestamp"]
===== `use_jms_timestamp`

  * Value type is <<boolean,boolean>>
  * Default value is `false`

Convert the JMSTimestamp header field to the @timestamp value of the event

[id="plugins-{type}s-{plugin}-username"]
===== `username`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Username to use for connecting to JMS provider.

[id="plugins-{type}s-{plugin}-yaml_file"]
===== `yaml_file`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Yaml config file

[id="plugins-{type}s-{plugin}-yaml_section"]
===== `yaml_section`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Yaml config file section name
For some known examples, see https://github.com/reidmorrison/jruby-jms/blob/master/examples/jms.yml[jms.yml examples].



[id="plugins-{type}s-{plugin}-common-options"]
include::{include_path}/{type}.asciidoc[]

:default_codec!:
