cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Setting grouping dynamically for general splitter

former_member537554
Participant
2,251

I have an integration in which I want to divide the incoming message load to max. 10 groupings and process them in in parallel. Currently, I'm looking at the general splitter parallel processing options. What I want to do is to set the grouping parameter dynamically so that we always end up with max. 10 groupings of messages.

My question is whether it is possible to parameterize the grouping parameter of the general splitter. I cannot find information in the documentation.

If there's an alternative solution for this please let me know as well.

Thanks in advance!

Bram

View Entire Topic
sunny_kapoor
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Bram,

You cannot use a property in grouping field of Splitter, that means you can not set the grouping dynamically.

But yes you can externalize or parameterize the grouping field but that doesn't make it dynamic.

You can try out the following approach but please do test it properly for perfromance:

1. Add a property with name grouping_number in content modifier and take its value from the payload during runtime.

2. Add multiple copies of Splitter where you hardcode the grouping numbers like Splitter1 with grouping 2, Splitter2 with grouping 4, etc.

3. Add a Router before your Splitters and based on the grouping_number property value direct it to the appropriate Splitter path. For Example if grouping_number = 2 then a router should execue the path of Spliterr1 where grouping is 2, if grouping_number = 4 then a router should execute the path of Spliterr2 where grouping is 4, so on and so forth.

Please let me know if this works.

former_member537554
Participant

Hi Sunny Kapoor,

Thanks for your answer! I decided to write a groovy script to be able to dynamically change the number of groups. This solution gives more flexibility in tuning processing. I shared my solution in this blog.

Thank you for helping out!

Bram

sunny_kapoor
Product and Topic Expert
Product and Topic Expert

Thank you Bram for the update and sharing your knowldege in the blog post.