JMSConsumer
Consume messages from a JMS queue or topic.
It is recommended to set maxWaitTimeout or maxMessages.
type: "io.kestra.plugin.jms.JMSConsumer"Examples
Consume 100 Messages from a JMS Queue
id: jms_consume
namespace: company.team
tasks:
- id: consume_from_queue
type: io.kestra.plugin.jms.JMSConsumer
connectionFactoryConfig:
type: DIRECT
providerJarPaths: kestra:///jms/activemq-client.jar
connectionFactoryClass: org.apache.activemq.ActiveMQConnectionFactory
username: admin
password: "{{ secret('AMQ_PASSWORD') }}"
destination:
name: my-queue
destinationType: QUEUE
maxMessages: 100
maxWaitTimeout: 5000
Properties
destination *RequiredNon-dynamicJMSDestination
The destination to consume messages from.
connectionFactoryConfig Non-dynamicConnectionFactoryConfig-DirectConnectionFactoryConfig-Jndi
Connection factory configuration.
Configuration for connecting to the JMS broker. Supports both direct connection factory instantiation and JNDI lookup.
maxMessages integerstring
1The maximum number of messages to consume. (default 1)
maxWaitTimeout integerstring
0The maximum time to wait for messages in milliseconds. (default 0, never times out)
messageSelector string
Message selector to only consume specific messages.
A JMS message selector expression to filter messages. Uses SQL-92 syntax (e.g., "JMSPriority > 5 AND type = 'order'").
serdeType string
STRINGSTRINGJSONBYTESThe format for deserializing the message body.
Determines how message bodies are deserialized. STRING for text messages, JSON for JSON-formatted text, BYTES for binary data.
Outputs
count integer
Number of messages consumed.
uri string
uriURI of a Kestra internal storage file containing the consumed messages.
Definitions
io.kestra.plugin.jms.configuration.ConnectionFactoryConfig-Jndi
jndiConnectionFactoryName *Requiredstring
JNDI Connection Factory Name
jndiInitialContextFactory *Requiredstring
JNDI Initial Context Factory
jndiProviderUrl *Requiredstring
JNDI Provider URL
connectionProperties object
Connection Properties
Additional (Pojo) properties to set on the Direct/JNDI ConnectionFactory instance.
jndiCredentials string
JNDI Credentials
jndiPrincipal string
JNDI Principal
password string
The password for broker authentication.
This is used when creating the connection to the JMS broker. Omit for JNDI if credentials are embedded in the ConnectionFactory.
providerJarPaths array
Provider JAR Path(s)
The path to the JMS provider's JAR file(s). This can be a single path or a list of paths (JARs). (e.g., 'file:///app/plugins/jms-libs/client.jar').If not specified, all jar files in the 'jms-libs' sub folder of your plugins location will be added to the classpath.
useFilteredClassLoader booleanstring
falseUse Filtered ClassLoader
Enable this for JMS providers that bundle JMS API classes in their JAR (e.g., SonicMQ/Aurea Messenger). When enabled, JMS API classes are loaded from the parent classloader to prevent ClassCastException. Leave disabled (default: false) for well-behaved providers like RabbitMQ, ActiveMQ, Artemis, etc. Only enable this if you encounter ClassCastException with javax.jms or jakarta.jms classes.
username string
The username for broker authentication.
This is used when creating the connection to the JMS broker. Omit for JNDI if credentials are embedded in the ConnectionFactory.
io.kestra.plugin.jms.configuration.ConnectionFactoryConfig-Direct
connectionFactoryClass *Requiredstring
Connection Factory Class
The fully qualified class name of the JMS ConnectionFactory.
connectionProperties object
Connection Properties
Additional (Pojo) properties to set on the Direct/JNDI ConnectionFactory instance.
password string
The password for broker authentication.
This is used when creating the connection to the JMS broker. Omit for JNDI if credentials are embedded in the ConnectionFactory.
providerJarPaths array
Provider JAR Path(s)
The path to the JMS provider's JAR file(s). This can be a single path or a list of paths (JARs). (e.g., 'file:///app/plugins/jms-libs/client.jar').If not specified, all jar files in the 'jms-libs' sub folder of your plugins location will be added to the classpath.
useFilteredClassLoader booleanstring
falseUse Filtered ClassLoader
Enable this for JMS providers that bundle JMS API classes in their JAR (e.g., SonicMQ/Aurea Messenger). When enabled, JMS API classes are loaded from the parent classloader to prevent ClassCastException. Leave disabled (default: false) for well-behaved providers like RabbitMQ, ActiveMQ, Artemis, etc. Only enable this if you encounter ClassCastException with javax.jms or jakarta.jms classes.
username string
The username for broker authentication.
This is used when creating the connection to the JMS broker. Omit for JNDI if credentials are embedded in the ConnectionFactory.
io.kestra.plugin.jms.JMSDestination
destinationName *Requiredstring
The name of the JMS queue or topic.
destinationType string
QUEUEQUEUETOPICThe type of the destination.