1
votes

We are developing POC for one of our future product where we have requirement like as follow.

Main app

  1. Poll order id from db, update its state once polled
  2. Split the order to each product id. Check validity of that product id against some business rules.
  3. Send all valid product ids as message to channel
  4. Wait for response from worker app and update status to finished or failed.

Worker App

  1. Picks up product id as message
  2. Send it to all fixed list of recipients
  3. Each recipient, validates its own rule before sending it to integration partner(External web services)
  4. Once send to external service, wait for configured amt of time for response. Collect response and do some db specific work to store response.
  5. Once all recipient finished, response needs to be send to Main app so that it can update status for main product id.

To achieve this, we have developed, spring integration app with spring JMS listener on worker app.

Main app is purely spring integration app where we have used db poller and jms outbound gateway.

Worker app is where I need some suggestions, what I have done so far is used, spring default message listener(Message driven pojo) to pick up message from jms queue. Once picked up, send it to fixed list of recipient. From here, each spring/spring integration component handles the flow to validate msg against business rule and send it to web service. Once response is received or timeout occurred, we update db to track each product id and its state and response data.

Now my problem starts here, how can i inform back the master app that all fixed list of integration has finished so that master app can update the order status.

Also remember, each product is being sent to 3-4 diff web services when picked up by single MDB(spring pojo msg listener). So if order has 3 items, then those items being sent to atleast 9 diff services.

Can anyone suggest how can i handle aggregation strategy?

1

1 Answers

0
votes

Now my problem starts here, how can i inform back the master app that all fixed list of integration has finished so that master app can update the order status.

You can use the same JMS Message Listener approach, where the Worker app produces its result to the queue and Main app just listen for that queue and picks ups a message for desired data. The <int-jms:message-driven-channel-adapter> is for your there.

each product is being sent to 3-4 diff web services when picked up by single MDB(spring pojo msg listener).

If you send them to the <puiblish-subscribe-channel> for all those services, we can get a gain with the built-in applySequence = true option on the <puiblish-subscribe-channel> and default CorrelationStrategy on the <aggregator>.

Everything else sounds good in your solution.