PulsarConsumer Activity

PulsarConsumer activity receives messages from the Apache Pulsar broker. The PulsarConsumer activity uses the Apache Pulsar client object to build consumers on the client to subscribe to the topics to receive messages.

General

The General panel contains the following fields:

Property Module Property? Yes/No Description
Name No The name to be displayed as the label for the shared resource in the process.
Pulsar Connection Yes Name of the Apache Pulsar connection.
Topic Name Yes The name of the topic from where the message is consumed. Regular expression pattern or multiple topic names, separated by comma, are supported in the Topic Name field. The Topic Name field has the following formats:
  • persistent://public/default/foo

  • non-persistent://public/default/foo

    Note: If persistent://<tenant>/<namespace>/ is not added as a prefix in the topic name, then it sets to the default tenant and namespace
    Note: For regular expression pattern, the topic name must be a persistent topic in one of the following formats:
    persistent://<tenant>/<namespace>/<topic>.*
    <tenant>/<namespace>/<topic>.*

    For comma separated pattern, the topic name must be in one of the following formats:
    persistent://<tenant>/<namespace>/<topic-name>,persistent://<tenant>/<namespace>/<topic-name>
    <tenant>/<namespace>/<topic-name>,<tenant>/<namespace>/<topic-name>
    <topic-name>,<topic-name>

Receive Mode No

The message can be received from the broker in Sync and Async modes.

Subscription Name Yes The name of the subscription.
Subscription Type No

The following options are available:

Exclusive: In the Exclusive mode, only a single consumer can attach to the subscription.
Shared: In the Shared mode, multiple consumers can attach to the same subscription. Messages are delivered in a round-robin distribution across consumers, and any given message is delivered to only one consumer.
Failover: In the Failover mode, multiple consumers can attach to the same subscription. Messages are delivered to the master consumer only. In the case of the failover of a master consumer, the next master is selected by the broker and further messages are redirected to the next master.
Key_Shared: In the Key_Shared mode, multiple consumers can attach to the same subscription. Messages are delivered in distribution across consumers and messages with the same key or the same ordering key are delivered to only one consumer.
Auto Acknowledgement No

Select the Auto Acknowledgement checkbox to automatically acknowledge a message received by the Pulsar Consumer activity. Clear the Auto Acknowledgement checkbox for client acknowledgment.

Note: To send a positive acknowledgment, ensure that the message is confirmed in the client mode using a TIBCO ActiveMatrix BusinessWorks™ Confirm activity. If a message is not acknowledged before the process instance ends, ActiveMatrix BusinessWorks Plug-in for Apache Pulsar sends a negative acknowledgment.

For more information, see the Apache Pulsar documentation.

Dead Letter Topic Yes

The Dead Letter Topic field is available only if the Subscription Type is Shared or Key_Shared and the Auto Acknowledgment checkbox is cleared. If the message is negatively acknowledged because of an internal activity fault, then the messages are redirected to the DLQ topic when the maximum delivery count is reached.

Max Delivery Count Yes The Max Delivery Count field is available only if the Subscription Type is Shared or Key_Shared and the Auto Acknowledgment checkbox is cleared. The number of times a negatively acknowledged message is redelivered before being rerouted to Dead Letter Topic.
Nack Redelivery Delay Yes The Nack Redelivery Delay field is available when the Auto Acknowledgment checkbox is cleared. The delay in seconds after which the message is redelivered when the message is negatively acknowledged.
Multi- Topic Subscription No

Select the Multi- Topic Subscription checkbox if topics are provided in regular expression patterns.

Multi- Topic Subscription Mode No

The Multi- Topic Subscription Mode field is available when the Multi- Topic Subscription checkbox is selected. The following options are available:

AllTopics: The consumer subscribes to both the persistent and non-persistent topics.
PersistentOnly: The consumer subscribes to the persistent topics.
NonPersistentOnly: The consumer subscribes to the non-persistent topics.

The default value is PersistentOnly. For more information, see Apache Pulsar documentation.

Description

On the Description tab, you can add a short description for the PulsarConsumer activity.

Advanced

The Advanced panel contains the following fields:

Input Item Module Property? Yes/No Description
Sequence Key No XPath expression that specifies which processes must run in a sequence. Process instances with sequencing keys that evaluate to the same value are run sequentially in the sequence the process instance was created.
Custom Job Id No This field can contain an XPath expression that specifies a custom ID for the process instance.
Message Format No

The following options are available for the message format:

None
String
JSON
Avro
Note: For Avro Message Format only simple schema with record type is supported and for JSON Message Format only simple schema is supported.
Batching No

Select the Batching checkbox to enable batching.

Note: The Batching checkbox is disabled when the Chunking checkbox is selected.
Max Num Of Messages Yes

Specifies the maximum number of messages that can be received within a particular batch.

Default: 1000

Max Byte In Batch Yes

Specifies the maximum number of bytes that can be received in a particular batch.

Default: 131702 bytes

Batch Timeout Yes

Specifies the maximum amount of time that the consumer waits to retrieve batch messages.

Default: 1000 ms

Batch Index Acknowledgment No This is a checkbox to enable the batch index acknowledgments. Ensure that the batch index acknowledgment is also enabled by setting the acknowledgmentAtBatchIndexLevelEnabled parameter to true at the broker side.
Chunking No

Select the Chunking checkbox to enable the chunking feature.

Note: The Chunking checkbox is disabled when the Batching checkbox is selected.
Chunk Max Pending Messages Yes Specifies the maximum size of a queue that can hold pending message chunks. After the Consumers reach this threshold, pending messages are dropped for optimizing the memory utilization. For more information, see Messaging section of Apache Pulsar documentation.
Default: 10
Expire Time Incomplete Chunk Messages Yes

Specifies the total time interval to expire the incomplete chunks, if the consumer fails to receive all the chunks of a message in the given time period.

Default: 60000 ms

Auto Ack Old Chunk Message[Queue Full] No Select the Auto Ack Old Chunk Message[Queue Full] checkbox to automatically acknowledge any pending message chunks when the Chunk Max Pending Messages threshold value is reached. If this checkbox is not selected, these messages are redelivered by the broker.
Geo Replication State No

Select the Geo Replication State checkbox to enable the geo replication feature.

Note: This feature is available for selective replication patterns only with Plain Pulsar Server.
Schema Definition File Yes Select a schema definition file for the schema type. This is only applicable for the JSON and Avro Schema Message Format.
Properties Yes You can set the name of the client configuration and value for the consumer.

Conversations

You can use the Conversations tab to initiate or join a conversation.

Conversations receive a message after the creation of the process instance, which is initiated or joined by an activity. This activity can be used to initiate a conversation. Click the Add New Conversation icon to initiate a conversation. For more information about conversations, see TIBCO ActiveMatrix BusinessWorks™ Application Design.

Output

The following is the output for the activity. The Output tab contains the following fields:

Output Item Data Type Description

topic

String The name of the topic on which the message has been received.
messageId String The message id of the message.
payload
  • base64Binary for None Message Format.

  • String for String, JSON, or Avro Message Format.

Payload of the message received.

Fault

The following table describes the error schema elements on the Fault tab of the PulsarProducer activity:

PulsarCreatedProducerOrConsumerException
Field Data Type Description
msg String The error message description returned by the plug-in.
msgCode String The error code returned by the plug-in.
PulsarPluginException
Field Data Type Description
msg String The error message description returned by the plug-in.
msgCode String The error code returned by the plug-in.
PulsarEventSourceFaultException
Field Data Type Description
msg String The error message description returned by the plug-in.
msgCode String The error code returned by the plug-in.