Question

I'm (very) new to Spring integration and looking to achieve the following;

  • I have one channel - called the work-channel
  • I have 3 distinct worker(s); Alice, Bob, Claire
  • Alice, Bob & Claire each take between 5-10 seconds to respond
  • A Message is posted onto the work-channel and the work is deemed completed when process by an Alice, Bob and Claire and they can work in parallel
  • There is 10 instances of each Alice, Bob & Claire (30 instances in total)

I'm simply looking to see what this pattern is called and what Endpoints you would use in Spring integration to be sure that all 3 workers process the request only ONCE and post their results to an output-channel but there are many workers listening on the same work-channel queue - I don't what to code something like an AliceManager and use threadexecutors internally but have spring-integration handle the full concurrency - is this possible?

I will have a single gateway, e.g. workersGateway.pushJobToWorks(job)

Was it helpful?

Solution

Well, since you say that you have only one entry point, but then you need to apportion each task by different services, so the Router pattern is for you.

Further you can use Executor Channel for each worker and it will be the concurrency.

I suggest to read book on the matter: EIP, Spring Integration in Action

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top