0
votes

I am currently using Spring Integration and the application does the following for each message received from MQ

  1. read the message
  2. transform
  3. post transformed message to an Api

To increase throughput, I wanted to change to the following

  1. read the message
  2. transform
  3. post to a queue channel
  4. call a batch api with 10 transformed messages

<channel id="apiChannel"> <queue size="10"/> </channel>

Would anyone be able to point me how I could implement this trigger, i.e wait for queue depth to be 10 or time from the 1st inserted msg is 2 seconds before calling a Service Activator with 10 messages?

1

1 Answers

1
votes

Use an aggregator (with a release strategy size == 10) instead of a queue channel. The correlation strategy can be a simple constant since you are aggregating size only.