In flight kinesis message fails on application shutdown when using spring cloud stream kinesis binder

53 views Asked by At

We are using spring cloud stream kinesis binder with KPL/KCL enabled, and the consumer consumes the message and saves its content to Redis DB.

We have a situation where upon application shutdown we are seeing the following exception

org.springframework.messaging.MessageDeliveryException: Dispatcher has no subscribers for channel 'errorChannel'.

; nested exception is org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers, failedMessage=ErrorMessage
[payload=org.springframework.messaging.MessageHandlingException: error occurred in message handler
 [org.springframework.cloud.stream.function.FunctionConfiguration$FunctionToDestinationBinder$1@55953172]

; nested exception is java.lang.IllegalStateException: LettuceConnectionFactory was destroyed and cannot be used anymore, failedMessage=GenericMessage [payload=byte[1227], headers={aws_shard=shardId-000000000153, id=95da5004-03be-329b-51c3-21156d910bc7, sourceData=UserRecord [subSequenceNumber=9, explicitHashKey=null, aggregated=true, getSequenceNumber()=49647126806637972373382297894350479884500647646903404946, getData()=java.nio.HeapByteBuffer

It seems that on the application shutdown LettuceConnectionFactory bean got destroyed before all in-flight messages were processed.

What can be done to resolve this issue?

0

There are 0 answers