Package com.technia.tif.enovia.kafka
Interface KafkaMessageReceiver
- All Known Implementing Classes:
KafkaDefaultMessageReceiver
@API
public interface KafkaMessageReceiver
Defines a contract for handling messages consumed from Kafka.
KafkaMessageReceiver represents a component responsible for
processing incoming Kafka messages within a KafkaMessageContext.
Implementations contain the business logic required to handle the message and
determine the outcome of processing.
The provided KafkaMessageContext gives access to both the underlying
Kafka record and additional processing capabilities, such as job creation and
callbacks.
- Since:
- 2026.2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when an exception occurs during message processing.voidHandles an incoming Kafka message.
-
Method Details
-
onMessage
Handles an incoming Kafka message.This method is invoked for each consumed message and is expected to implement the processing logic for that message.
- Parameters:
ctx- theKafkaMessageContextassociated with the message- Throws:
Exception- if message processing fails; throwing an exception signals a processing error to the caller
-
onException
Called when an exception occurs during message processing.- Parameters:
ctx- the exception context associated with the failed message
-