spring-cloud-aws icon indicating copy to clipboard operation
spring-cloud-aws copied to clipboard

Enable receiving messages from different message groups in the same Batch for FIFO queues

Open tomazfernandes opened this issue 1 year ago • 3 comments

See https://github.com/awspring/spring-cloud-aws/issues/1020

For this we need to add a ContainerOptions to use in the FifoSqsComponentFactory to determine the proper Sink composition.

tomazfernandes avatar Feb 07 '24 23:02 tomazfernandes

Hello @tomazfernandes ,

From what I've seen and in relation to your messages, I think we should add an option in SqsContainerOptions to not use the MessageGroupingSinkAdapter but another one that doesn't group by message group.

Is that right? If yes, I can do it ! Thanks !

alexisgra avatar Mar 20 '24 16:03 alexisgra

Hey @alexisgra, yup, that sounds about right!

Go for it, I'll be happy to look at the PR.

tomazfernandes avatar Mar 20 '24 22:03 tomazfernandes

Hi @tomazfernandes, Thanks for your answer! I'm currently working on the PR. I was wondering if I should expose a property in the @SqsListener annotation? Or just in the factory? From what I understand from #1020, the use case may seem rather edgy. Moreover, the property only makes sense for FIFO queues with a BATCH listener.

For now, I've added a boolean messageGrouping field to the SQSContainerOptions, which defaults to true and is used in the FifoSqsComponentFactory to choose the right Sink composition.

Thanks for your help !

alexisgra avatar Mar 26 '24 20:03 alexisgra