You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2023/07/28 05:42:40 UTC

[GitHub] [camel] oscerd commented on a diff in pull request #10870: kinesis connection retry mechanism added into the current consumer

oscerd commented on code in PR #10870:
URL: https://github.com/apache/camel/pull/10870#discussion_r1277110406


##########
components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Endpoint.java:
##########
@@ -99,12 +101,20 @@ public Producer createProducer() throws Exception {
 
     @Override
     public Consumer createConsumer(Processor processor) throws Exception {
-        final Kinesis2Consumer consumer = new Kinesis2Consumer(this, processor);
+        var kinesisConnection = KinesisConnection.getInstance();
+        final Kinesis2Consumer consumer = new Kinesis2Consumer(this, processor, kinesisConnection);
         consumer.setSchedulerProperties(getSchedulerProperties());
+        startHealthChecks(kinesisConnection);
         configureConsumer(consumer);
         return consumer;
     }
 
+    private void startHealthChecks(KinesisConnection kinesisConnection) {

Review Comment:
   For this you could use the executor service we have in Camel, like we did here: 
   
   https://github.com/apache/camel/blob/main/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/stream/AWS2S3StreamUploadProducer.java#L83



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org