App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

IBM Integration Bus (IIB) Development Best Practice – Flow Hopping (Part 1)

By Francois van der Merwe posted Thu February 25, 2021 12:16 AM

  

“Flow Hopping” is the practice where you create a solution in IIB and you break it up into smaller message flows with some communication like MQ or SOAP calls as the connecting mechanism between the smaller message flows.

In this blog I’m going to illustrate the performance penalty, if any, you pay if you do this. Please make sure to read the results as well, because maybe the answer is not 100% intuitive.

1.1 Hardware and Software versions

My trusty laptop, ThinkPad W540 with 16Gb of memory, running IBM Integration Bus V10.0.0.4 and IBM MQ V8.

1.2 Example

In this example, I’m going to use a very simple setup. Stringing together 4 message flows with MQ queues in between to create a message flow hopping example, see Figure 1. I’m starting the sequence by putting a dummy message into the first queue. Every one of the last three message flows will use a mapping node to transform the input data.

image 1.png

Figure 1- Flow hopping

As a counter I’ll have one consolidated message flow that is consuming an MQ message, it will then transform the data with the help of the same three mapping nodes used in Figure 1 and the result will be written back into an MQ queue, see Figure 2.
image 2.png
Figure 2 - Consolidated Flow

In both scenarios above the first flow consumes the dummy message out of the queue and then loops 25 000 times to populate the input queue for the real performance test. The message flow used for this looks like Figure 3.

image 3.png

Figure 3 - Loop x times

The ESQL code in the “LoopX” node is shown in Figure 4. In this example, it will loop 25000 times and create the same message as shown in Figure 5 in the downstream queue “Hop1”. I’ve spaced the data in order to make it more readable for this write-up.
image 9.pngFigure 4 - LoopX code

image 10.pngFigure 5 - Input data

The mapping nodes in all the flows use two XSD files, generated in the Toolkit from sample XML, see Figure 6 and Figure 7.

fig 6.PNGFigure 6 - HOP1 XSD

fig 7.PNG

Figure 7 - HOP2 XSD

The setup of the message flows 2 and 3 in Figure 1 look as follows, see Figure 8 and message flow 4 looks as in Figure 9.  The reason the fourth message flow has a node in to remove the MQ header is because I’m using the put timestamp in the message to calculate the overall time taken to execute, and by removing the MQ header I’m forcing a new timestamp into the final message.

image 4.png

Figure 9 - Hopping flow

image 5.pngFigure 9 - Last hopping flow

Each of the smaller hopping message flows will consume a message from a queue, map the input and write the resultant to an output queue.  The mapping in this message flow looks like Figure 10.

image 6.pngFigure 10 - Simple mapping message flow 2 

For completeness, the mapping in the third message flow looks like Figure 11 and the mapping for message flow four looks exactly the same as in Figure 10.

image 7.png

Figure 11 - Simple mapping message flow 3

The consolidated flow from Figure 2 has the message flow layout as in Figure 12.  Please note as before I’m using the removal of the MQ header to force a new timestamp in the MQ message going to the queue “Hop4”.

image8.pngFigure 12 - Consolidate flow message flow

In Figure 12 the mappings inside “Mapping” and “Mapping2” looks the same as in Figure 10 and the mapping in “Mapping1” looks the same as in Figure 11, in fact, in the application they are 100% the same mappings shared in a library.

 

DOWNLOAD THE TEST FILE HERE          READ PART 2

2 comments
148 views

Permalink

Comments

Thu March 25, 2021 06:08 AM

Hi Francois, 
Not able to view the images . Can you please check and update the hyperlink for images

Thanks,
Santhosh

Fri August 05, 2016 06:40 PM

Thanks!

Wow, Francois! This is very thorough! Thanks for sharing and I'm looking forward to Part 2. :-)