Search code examples
apache-camelapache-camel-aws-kinesisapache-camel-aws

Using Apache Camel AWS-KINESIS endpoint, how do I checkpoint the message in the Kinesis stream?


I use AWS-KINESIS endpoint in Camel to read from a AWS Kinesis contentstream. I can read messages just fine, but how do I checkpoint the message on the stream? In the standard AWS Kinesis Java client library you have the concept of Workers and Processors, but this is bypassed entirely in Camel it seems.

My route:

  from("aws-kinesis://" + CONTENT_STREAM_NAME + "?amazonKinesisClient=#kinesisClient").
        routeId(KINESIS_EVENT_READ).
        bean(recordHandler);

In the recordhandler I would like to checkpoint the records when the record is processed correctly.

The RecordHandler's @Handler

    @Handler
    public void handleRecord(@Body Record record) {
        processEvent(record); // I would like to checkpoint after this...
    }

Any pointers?


Solution

  • AWS-KINESIS for Camel currently uses the synchronous Kinesis portion of the AWS SDK. The Workers, Processors and Checkpointing you are refering to are from the KCL (Kinesis Client Libary), which is a more advanced way of accessing Kinesis (including a thread per partition, and checkpointing). There doesn't appear to be a KCL based consumer Component for Camel yet, nor a corresponding KPL based producer Component.