Using JMS

The Flowable Engage application uses JMS to communicate with the adapters that are responsible for communicating with the third party external systems (e.g., WhatsApp, WeChat, etc.).

The Flowable Engage listens to the defined queues only if the appropriate external system dependency is present.

Queues

These are the queues that the Flowable Engage Application is subscribed to:

Table 1. Flowable Engage Queues
Third Party system Property Default Value

WhatsApp

flowable.external-system.whatsapp.inbound-payload

whatsapp-inbound-payload

flowable.external-system.whatsapp.inbound

whatsapp-inbound

flowable.external-system.whatsapp.inbound-status

whatsapp-inbound-status

flowable.external-system.whatsapp.inbound-error

whatsapp-inbound-error

WeChat

flowable.external-system.wechat.inbound

wechat-inbound

flowable.external-system.wechat.inbound-status

wechat-inbound-status

flowable.external-system.wechat.inbound-error

wechat-inbound-error

flowable.external-system.wechat.get-access-token

wechat-get-access-token

flowable.external-system.wechat.store-access-token

wechat-store-access-token

Table 2. Flowable WhatsApp Adapter Queues
Property Default Value

flowable.adapter.whatsapp.jms.outbound

whatsapp-outbound

Table 3. Flowable WeChat Adapter Queues
Property Default Value

flowable.adapter.wechat.jms.outbound

wechat-outbound

These are the JMS queues (and properties) that the Flowable applications are sending to:

Table 4. Flowable Engage destination queues
Third Party system Property Default Value

WhatsApp

flowable.external-system.whatsapp.outbound

whatsapp-outbound

WeChat

flowable.external-system.wechat.outbound

wechat-outbound

Table 5. Flowable WhatsApp Adapter destination queues
Property Default Value

flowable.adapter.whatsapp.jms.inbound-payload-destination

whatsapp-inbound-payload

flowable.adapter.whatsapp.jms.inbound-message-destination

whatsapp-inbound

flowable.adapter.whatsapp.jms.inbound-status-destination

whatsapp-inbound-status

flowable.adapter.whatsapp.jms.inbound-error-destination

whatsapp-inbound-error

Table 6. Flowable WeChat Adapter destination queues
Property Default Value

flowable.adapter.wechat.jms.inbound-message-destination

wechat-inbound

flowable.adapter.wechat.jms.inbound-status-destination

wechat-inbound-status

flowable.adapter.wechat.jms.inbound-error-destination

wechat-inbound-error

flowable.adapter.wechat.jms.get-access-token-destination

wechat-get-access-token

flowable.adapter.wechat.jms.store-access-token-destination

wechat-store-access-token

IBM MQ

Flowable provides out of the box support for using the IBM MQ client. In order to use the IBM client you need to add the following dependency:

<dependency>
    <groupId>com.flowable.platform</groupId>
    <artifactId>flowable-spring-boot-starter-ibm-mq</artifactId>
    <version>${com.flowable.platform.version}</version>
</dependency>

This dependency pulls in the needed transitive dependencies for communicating with IBM MQ.

When using IBM MQ the values for the queues should be changed. The reason for the changes is that IBM MQ does not support the use of the "-" character in the name of the queue.

Default Configuration

The selected default options have been set in order to match the IBM MQ Docker Container development configuration. The created MQConnectionFactory is by default wrapped in a Spring CachingConnectionFactory.

The default values are:

flowable.ibm.mq.host=localhost
flowable.ibm.mq.port=1414
flowable.ibm.mq.channel=DEV.APP.SVRCONN
flowable.ibm.mq.queue-manager=QM1
flowable.ibm.mq.application-name=
flowable.ibm.mq.user=app
flowable.ibm.mq.password=

Extended Configuration Options

Changing the default configuration is done by defining your properties in an application.properties file, environment properties, system properties, etc. For more information see Using Spring Boot Properties.

Pooled Connection Factory Options

There is an option to enable using the JmsPoolConnectionFactory. This is disabled by default. It can be configured by using the following properties:

Table 7. IBM MQ Pool Connection Factory properties
Property Description Default Value

flowable.ibm.mq.pool.enabled

Use JmsPoolConnectionFactory.

false

flowable.ibm.mq.pool.block-if-full

Block a connection when the pool is full.

true

flowable.ibm.mq.pool.block-if-full-timeout

Blocking period before throwing an exception if the pool is still full.

-1

flowable.ibm.mq.pool.idle-timeout

Connection idle timeout.

30 seconds

flowable.ibm.mq.pool.max-connections

Maximum number of pooled connections.

1

flowable.ibm.mq.pool.max-sessions-per-connection

Maximum number of pooled sessions per connection in the pool.

500

flowable.ibm.mq.pool.time-between-expiration-check

Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.

-1

flowable.ibm.mq.pool.use-anonymous-producers

Whether to use only one anonymous "MessageProducer" instance. Set it to false to create one "MessageProducer" every time one is required.

true

Cached Connection Factory Options

By default the Spring CachingConnectionFactory is used with the following properties:

Table 8. IBM MQ Cached Connection Factory properties
Property Description Default Value

spring.jms.cache.enabled

Whether to cache sessions.

true

spring.jms.cache.consumers

Whether to cache message consumers.

false

spring.jms.cache.producers

Whether to cache message producers.

true

spring.jms.cache.session-cache-size

Size of the session cache (per JMS Session type).

-1

ActiveMQ

Flowable provides out of the box support (via Spring Boot) for using the ActiveMQ client. In order to use ActiveMQ add the following dependency:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-activemq</artifactId>
</dependency>

This dependency pulls in the needed transitive dependencies for communicating with ActiveMQ.

Configuration Options

Configuring the connection with ActiveMQ is done by defining your properties in an application.properties file, environment properties, system properties, etc. For more information see Using Spring Boot Properties.

ActiveMQ Connection Factory Options

Table 9. ActiveMQ Connection Factory properties
Property Description Default Value

spring.activemq.broker-url

URL of the ActiveMQ broker. Auto-generated by default.

-

spring.activemq.in-memory

Whether the default broker URL should be in memory. Ignored if an explicit broker has been specified.

true

spring.activemq.user

Login user of the broker.

-

spring.activemq.password

Login password of the broker.

-

spring.activemq.close-timeout

Time to wait before considering a close complete.

15 seconds

spring.activemq.non-blocking-delivery

Whether to stop message delivery before re-delivering messages from a rolled back transaction. This implies that message order is not preserved when this is enabled.

false

spring.activemq.non-blocking-delivery

Time to wait on message sends for a response. Set it to 0 to wait forever.

0

spring.activemq.package.trust-all

Whether to trust all packages.

-

spring.activemq.package.trusted

Comma-separated list of specific packages to trust (when not trusting all packages).

-

Pooled Connection Factory Options

There is an option to enable using the JmsPoolConnectionFactory. This is disabled by default. It can be configured by using the following properties:

Table 10. ActiveMQ Pool Connection Factory properties
Property Description Default Value

spring.activemq.pool.enabled

Use JmsPoolConnectionFactory.

false

spring.activemq.pool.block-if-full

Block a connection when the pool is full.

true.

spring.activemq.pool.block-if-full-timeout

Blocking period before throwing an exception if the pool is still full.

-1

spring.activemq.pool.idle-timeout

Connection idle timeout.

30 seconds

spring.activemq.pool.max-connections

Maximum number of pooled connections.

1

spring.activemq.pool.max-sessions-per-connection

Maximum number of pooled sessions per connection in the pool.

500

spring.activemq.pool.time-between-expiration-check

Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.

-1

spring.activemq.pool.use-anonymous-producers

Whether to use only one anonymous "MessageProducer" instance. Set it to false to create one "MessageProducer" every time one is required.

true

Cached Connection Factory Options

By default the Spring CachingConnectionFactory is used with the following properties:

Table 11. ActiveMQ Cached Connection Factory properties
Property Description Default Value

spring.jms.cache.enabled

Whether to cache sessions.

true

spring.jms.cache.consumers

Whether to cache message consumers.

false

spring.jms.cache.producers

Whether to cache message producers.

true

spring.jms.cache.session-cache-size

Size of the session cache (per JMS Session type).

-1