mq-activiti-ext/apidocs/bean-mqSubscribeDelegate.md
2025-03-11 09:46:52 -04:00

5.5 KiB

API Documentation: MQ Activiti Extension: mqSubscribeDelegate

Author: brian@inteligr8.com Since Version: 1.0

This delegate listens for messages on an MQ queue.

This is expected to exist in a Service Task immediately after a plain start activity. This will cause process instances to automatically be created in order to maintain the MQ subscription as messages are received. If used in any other way, it will error and the process will fail validation.

This does not wait for a response to a specific message, but instead to all messages put on an MQ queue. That is for the mqSubscribeReplyDelegate delegate.

If you have more than one MQ communication in a single process, set the mq_messageName field on this task. The resultant variables will then include that message name (e.g. mq_messageId_{mq_messageName}).

This requires a long running connection to MQ. It runs in a long running Activiti job/execution. If there is a failure or the server is restarted, the Activiti job will fail and automatically retry per the Activiti standard features. After exhausting retries, it may eventually dead-letter. Retry the job to continue the subscription.

See Also: mqPublishDelegate See Also: mqSubscribeReplyDelegate

Delegate Expression Uses

This bean may be used as a Delegate using the "Delegate Expression" field as shown in the snippet below.

${mqSubscribeDelegate}

You may use it in a Service Task.

This method makes this bean an Activiti delegate.

Input Type Name Java Type Documentation
BPMN Field mq_connectorId An Activiti App Tenant Endpoint ID or Java system property in the format inteligr8.mq.connectors.{connectorId}.url. Using system properties support url, username, and password.
BPMN Field mq_queueName The name of an MQ destination (queue or topic). This is the target of the message. If it doesn't exist, it will be created.
BPMN Field mq_metadataProcessScope [optional] true to set all Activiti result variables in the process instance scope; otherwise the variables will be local to the task.
BPMN Field mq_messageName [optional] A unique identifier to append to Activiti result variable names when more than one MQ message publication/subscription is supported by a process.
BPMN Field mq_concurrency The number of process instances to simultaneously listen on the queue. Only positive numbers are accepted.
Result Type Java Type, Name, or Error Code Documentation
Activiti Variable mq_correlationId The correlating identifier of the message received. Use to correlate between sent/received messages; like a thread of communication.
Activiti Variable mq_messageId The unique message identifer of the message received.
Activiti Variable mq_deliveryTime The time the message was delivered; not received. It is of the java.util.Date type as supported by Activiti.
Activiti Variable mq_priority An integer priority of the message; value depends on MQ protocol.
Activiti Variable mq_payload The body of the MQ message. May include expressions. May be null.
Activiti Variable mq_payloadMimeType The MIME type of the body of the MQ message. May be null.
Activiti Variable mq_replyQueueName The name of an MQ destination (queue or topic) to use to reply to the received message. The reply message must have the same correlating identifier. May be null.
Activiti Variable mq_statusQueueName The name of an MQ destination (queue or topic) to use to reply to the received message. The reply message must have the same correlating identifier. May be null.
Thrown BPMN Error timeout The MQ connection timed out connecting or waiting for a message.
Thrown BPMN Error network The MQ connection experienced network issues.
Thrown BPMN Error mq An unknown MQ issue occurred.

See Also: mqPublishDelegate See Also: mqSubscribeReplyDelegate


Back to Index

Generated by the Inteligr8 Activiti API Doclet.