How to run parallel Aggregators in Spring Integration? -


i'd run spring integration flow can scale instances of components if capacity of reached.

in particular, wonder how scale aggregators in following scenario: various components right before aggregator layer produce different parts of objects of class x - let's produce parts of 2 such objects x1, x2 - parts called {a1, b1} , {a2, b2}, respectively. aggregators should construct x1 , x2 parts , send them on. let's assume there's 2 aggregators, a1 , a2.

enter image description here

how can set works expected, i.e. x1 , x2 created , sent off?

i see following considerations:

  • a1 gets a1, a2 gets b1, , x1 can't constructed without here.
  • we want load balancing, reason multiple aggregators in first place.
  • extra aggregators should added if needed - static configuration of number of aggregators avoided.

i wonder if following work me - based on spring integration docs, i'm not sure if got right.

  1. set redis message store, parts of x1 , x2 stored before available.
  2. share message store between aggregator instances. setting (6) in aggregator configuration.
  3. (as usual aggregator) tag parts (a's , b's) of same x same correlation_id. write releasestrategy based on both , b having been received.
  4. create redis lock registry , configure aggregators use it. setting (20) in aggregator configuration.

will do? in particular:

  1. can share messagestore between multiple aggregators?
  2. when sharing messagestore, if a1 writes a1 , a2 writes b1, releasestrategy see x1 ready assembled?
  3. will 1 aggregator process aggregation using releasestrategy , send off assembled x, because i'm using locks?

many thanks!

yes work, don't need redis, unless need persistence or aggregators running on different boxes (but see below that); can share same simplemessagestore between aggregators. default, each aggregator uses own in-memory simplemessagestore.

and, yes, locks (by correlationid) ensure 1 aggregator process group @ same time.

... because i'm using locks ...

the aggregator uses own locks internally, don't need lock yourself. in fact, global lockregistry (gemfire, redis, custom implementation), , persistent message group store (redis etc), aggregators can run on different jvms.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -