Configuration of the Kafka_TransactionSample Processes

Kafka_TransactionSample

The sample project contains three processes. Each process has a different function. After Importing the Sample Project, expand the Processes resource to display the processes.

This sample project contains the following three processes:

  • Receive_Message.bwp
  • Send_Message.bwp
  • SubProcess.bwp

Send_Message.bwp

This process demonstrates how to use the plug-in to implement Kafka transactions. The Kafka SendMessage activity which participates in a transaction are added to the Local Transaction Group. The Local Transaction Group is configured with transport type Kafka. All the Kafka SendMessage activities which belongs to a transaction should share the same Transaction ID and Kafka connection shared resource. A critical section group is used to handle Kafka transactions when multiple threads are executing in parallel. The process demonstrates two scenarios:
  1. In the first Local Transaction Group, one or more Kafka SendMessage activity participates in a transaction and the transaction gets committed successfully.
  2. In the second Local Transaction Group, one or more Kafka SendMessage activity participates in a transaction but the transaction gets aborted due to an exception thrown from within the transaction group.

Activity configuration for the Send_Message.bwp:

SubProcess.bwp

The subprocess demonstrates Kafka SendMessage activity participating in the transaction initiated by parent process if it is configured with identical Transaction ID and the Kafka connection shared resource. Spawned subprocess will not participate in the parent initiated transaction.

Activity configuration for the SubProcess.bwp:

Receive_Message.bwp

This process demonstrates how to use the Kafka ReceiveMessage activity to receive transactional messages. In the Advanced tab, the isolation level is configured to read_committed which ensures that the activity will receive only those messages which are successfully committed during the transaction.

Activity configuration for the Receive_Message.bwp: