🎄 Happy Holidays! 🥳
Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.
Happy Holidays!
Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.
Batch processing with Spring Cloud Stream
Hi Solace Community,
It's me again. So we moved from RabbitMQ to Solace and identified that Solace does not support batch mode.
See: https://solace.community/discussion/811/spring-cloud-stream-batch-mode
So we started to implement a manual Acknowledgement function to accomplish something similar. But we are stuck in one particular case where the messageCount is less than the batchSize.
For example, if the batchSize = 10 and there are 5 messages in the queue it doesn't trigger the minimum required messages for the upstream service.
So my question is there any way to find out the last message in the queue or get some information if there are any more messages in the queue?
Here you have a simplified code snippet of the problem.
@Bean public Consumer<Message<ArticleTypeTwo>> articleConsumeSolace() { List<ArticleTypeTwo> articleList = new ArrayList<ArticleTypeTwo>(); List<AcknowledgmentCallback> acknowledgment = new ArrayList<AcknowledgmentCallback>(); return (msg) -> { AcknowledgmentCallback acknowledgmentCallback = StaticMessageHeaderAccessor.getAcknowledgmentCallback(msg); // (1) acknowledgmentCallback.noAutoAck(); ArticleTypeTwo article = msg.getPayload(); articleList.add(article); messageCount++; // Send articles in batch to portal if (batchSize == messageCount) { sendBatchToPortal(articleList, acknowledgment); }}; }
Thanks a lot for your support.
Best Answer
-
We are looking at batch processing in the Solace binder and should likely have something in place in Q1 2022.
0
Answers
-
We are looking at batch processing in the Solace binder and should likely have something in place in Q1 2022.
0