Search code examples
spring-integrationspring-integration-aws

Spring Integration AWS Kinesis Message Hanlder


The KinesisMessageHandler class accepts a constructor with input as AmazonKinesisAsync. AmazonKinesisAsync is an interface for accessing Kinesis asynchronously. Does this mean that there is no synchronous support for KinesisMessageHandler?

Also, what is the relevance of setSync method in KinesisMessageHandler?


Solution

  • The AmazonKinesisAsync is really just rely on a Java's Future which could be turned easily to sync, blocking behavior via its get() method. That's what is that setSync() on the KinesisMessageHandler states for. Having AmazonKinesisAsync as an input does not mean that we cannot do sync operations. If we would have opposite for AmazonKinesis contract, we would not be able to perform async operations.