Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IBM Integration Bus, best practices for calling multiple services

So I have this requirement, that takes in one document, and from that needs to create one or more documents in the output.

During the cause of this, it needs to determine if the document is already there, because there are different operations to apply for create and update scenarios.

In straight code, this would be simple (conceptually)

InputData in = <something>

if (getItemFromExternalSystem(in.key1) == null) {
     createItemSpecificToKey1InExternalSystem(in.key1);
}
if (getItemFromExternalSystem(in.key2) == null) {
     createItemSpecificToKey2InExternalSystem(in.key1, in.key2);
}
createItemFromInput(in.key1,in.key2, in.moreData);

In effect a kind of "ensure this data is present".

However, in IIB How would i go about achieving this? If i used a subflow for the Get/create cycle, the output of the subflow would be whatever the result of the last operation is, is returned from the subflow as the new "message" of the flow, but really, I don't care about the value from the "ensure data present" subflow. I need instead to keep working on my original message, but still wait for the different subflows to finish before i can run my final "createItem"

like image 525
Soraz Avatar asked Jan 21 '26 08:01

Soraz


1 Answers

You can use Aggregation Nodes: for example, use 3 flows:

  1. first would be propagate your original message to third
  2. second would be invoke operations createItemSpecificToKey1InExternalSystem and createItemSpecificToKey2InExternalSystem
  3. third would be aggregate results of first and second and invoke createItemFromInput.
like image 78
Aleksawka Avatar answered Jan 22 '26 20:01

Aleksawka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!