How to avoid concurrent calls to the Rest service from HTTPClient Connector across Process Instances. Is there any way for this?
I am not aware of an out of the box solution for this in boomi.
One possible solution could be:
1 - create a "lock" on a groovy script shape before the connector call (Use a singleton object with a synchronized methods or a lock implementation).
2 - If the lock is "on" the code is in loop (with a Thread.sleep) until the lock is ready. Define a timeout for waiting for a lock. If it is reached, throw an exception.3 - If the lock is "off", set it to "on" and exit the loop.
Note: this solution does not guarantee order, thereby deoes not prevent thread starvation!
This seems to be a nice feature out of the box for boomi, either the lock or the throttling of the outbound connectors!You may create an idea for this!The community may have a better solution for this, lets wait and see!
Hope this helps!**If the post solves your problem, mark it as "Correct Answer".**You can say "Thank you" by clicking the "star" in the post that helped you.
I'm not sure that using a lock instance in a groovy script is guaranteed to work. that only works if all instances of the same groovy script use the same classloader within the atom. this may be generally true, but may be cases where it is not true, which could result in erratic behavior. writing that locking util as a custom library would be a more reliable solution.
some sort of generic throttling mechanism is an interesting idea for boomi. however, the complicating factor of making it a built-in feature is dealing with the behavior across all the runtime environments (atom/molecule/cloud). in the molecule/cloud environment you either have to deal with distributed locking (and all the ensuing complexity), or accept that it is "local locking" only, which might not be very useful.
Of course, I am assuming that this is running on the same atom and same jvm
Retrieving data ...