TIBCO BusinessEvents - Kafka input destination messages processed twice (autoCommit and Cache enabled)

TIBCO BusinessEvents - Kafka input destination messages processed twice (autoCommit and Cache enabled)

book

Article ID: KB0071916

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 6.x

Description

The Kafka message can be processed twice by the InferenceAgent when AutoCommit set to true for the Kafka input destination and in-built cache has been enabled.

Environment

All Operating Systems

Resolution

This is a configuration issue, by default, the Kafka message will be committed in a separate thread as part of the PostRTC actions. Due to this the worker thread receives and process the same message again when pull the next message from the Kafka topic.

To avoid the issue there are two options available.

1. Disable enableParallelOps so that the original message is committed by the same worker thread itself.

To disable add CDD property "Agent.<agentname>.enableParallelOps" for the Inference-Agent classes and set the value to false.
e.g., - if Inference agent class name is "inference-class"

<property name="Agent.inference-class.enableParallelOps" value="true"/>

2. Explicitly Acknowledge the message inside rule action
To do this acknowledge the message in a Rule with catalog function "Event.acknowledgeEvent(<event>);"

Note:
The Threading model must set to "Callers thread" in CDD when auto commit has been enabled for the Kafka topic. 

Issue/Introduction

TIBCO BusinessEvents - Kafka input destination messages processed twice (autoCommit and Cache enabled)