2

I am using stream listener to consume the messages from amazon kinesis stream.

@StreamListener(Processor.Input)
public void receiveMessage(String message) {
  //process    
}
  1. Is it possible to implement a listener which will get all the messages once from Input stream every 10 minutes
  2. When there are consumer groups how will it behave. Does all containers in Consumer group get different messages list.

I tried with @Poller but it does not have any inputchannel.

Any help on this would be great.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Patan
  • 17,073
  • 36
  • 124
  • 198

1 Answers1

1

There is no such a Polling Consumer implementation for the AWS Kinesis. However you can simulate it with the such a combination:

listenerMode = batch

you will receive the payload in the @StreamListener as a List<com.amazonaws.services.kinesis.model.Record>

The recordsLimit by default is 10000. I think this should be enough to poll as much as possible.

idleBetweenPolls = 600000 / 10 mins

You won't go to the next batch earlier than this option.

No, each consumer in the group will get its own list. But that doesn't fit to your original requirement about polling everything. Therefore all other consumers in the same group will idle - nothing to poll for them!

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • I have tried the solution, but I get the message conversion exceptions. Can you please check here https://stackoverflow.com/questions/49730808/unable-to-consumer-messages-as-batch-mode-in-kinesis-binder – Patan Apr 09 '18 at 10:30