Changes for page Asynchronous Routing
Last modified by Danniar Firdausy on 2024/09/04 09:01
From version 24.1
edited by Carlijn Kokkeler
on 2022/10/05 12:15
on 2022/10/05 12:15
Change comment:
There is no comment for this version
To version 17.1
edited by Erik Bakker
on 2022/06/13 11:19
on 2022/06/13 11:19
Change comment:
Renamed from xwiki:Migrated Pages.Asynchronous Routing
Summary
-
Page properties (5 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,0 @@ 1 -Asynchronous Routing - Parent
-
... ... @@ -1,1 +1,0 @@ 1 -WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. CarlijnKokkeler1 +XWiki.ebakker - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Content
-
... ... @@ -1,8 +1,13 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 += Asynchronous Routing = 3 + 2 2 In this microlearning, we will explain the basics of asynchronous routing that plays a vital role in the distribution of messages within the five-layer model of messaging. 3 3 4 4 Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 5 5 8 +* Last update: February 25th, 2021 9 +* Required reading time: 7 minutes 10 + 6 6 == 1. Prerequisites == 7 7 8 8 * Basic knowledge of the eMagiz platform ... ... @@ -18,6 +18,8 @@ 18 18 * Based on a decision made within the routing the message is routed to one or more offramp queues 19 19 * Each offramp queue will receive data based on the decision unless you add another filter before the messages are sent to the offramp queue 20 20 26 + 27 + 21 21 == 3. Asynchronous routing == 22 22 23 23 Asynchronous routing plays a crucial role in the distribution of messages it receives to one or more offramps. ... ... @@ -34,16 +34,14 @@ 34 34 35 35 The best practice for setting up your asynchronous routing process is to use one SpEL expression that determines to which offramp queues a messages needs to be routed. 36 36 The SpEL expression looks as follows: 37 - {{code language=<providedlanguage>}}44 + 38 38 headers.{technicalnameofproject}\_targetSystem.split(',').![#this.trim()+#root.headers.{technicalnameofproject}_messageType] 39 -{{/code}} 40 -headers.{technicalnameofproject}\_targetSystem.split(',').![#this.trim()+#root.headers.{technicalnameofproject}_messageType] 41 41 42 42 This SpEL expression does the following things: 43 43 44 - *It looks for the header called {technicalnameofproject}\_targetSystem and will split each entry based on the separator (a comma)45 - *It will trim the result of this split and combine it the value in the header called {technicalnameofproject}\_messageType46 - *For every unique combination it will search to a pre-configured list to see to which channel the message should be sent49 +1. It looks for the header called {technicalnameofproject}\_targetSystem and will split each entry based on the separator (a comma) 50 +2. It will trim the result of this split and combine it the value in the header called {technicalnameofproject}\_messageType 51 +3. For every unique combination it will search to a pre-configured list to see to which channel the message should be sent 47 47 48 48 In the standard router component this will look as follows: 49 49 ... ... @@ -62,10 +62,16 @@ 62 62 63 63 === 3.2 Control output === 64 64 65 -As the asynchronous routing plays a role in routing messages between all asynchronous flows in the messaging solution you can imagine that making changes does not need to happen lightly. The other aspect is that when multiple projects are being built at the same time the asynchronous routing will house a multitude of changes that need to go to Acceptance or Production at the same time. 70 +As the asynchronous plays a role in routing messages between all asynchronous flows in a 71 +the messaging solution you can imagine that making changes does not need to happen lightly. 72 +The other aspect is that when multiple projects are being built at the same time the asynchronous routing 73 +will house a multitude of changes that need to go to Acceptance or Production at the same time. 66 66 67 -One control mechanism we consider a best practice to guard yourself against those risks is to add a filter before data is placed on the offramp queue. 68 -By doing this consistently you can control when a specific offramp can receive data on any environment. In other words, when a certain system is not ready yet to receive data on Acceptance or Production but is ready on Test you can control this behavior with this solution. 75 +One control mechanism we consider a best practice to guard yourself against those risks is to add a filter 76 +before data is placed on the offramp queue. 77 +By doing this consistently you can control when a specific offramp can receive data on any environment. 78 +In other words, when a certain system is not ready yet to receive data on Acceptance or Production but is ready on Test 79 +you can control this behavior with this solution. 69 69 70 70 Below you see how this will look on flow level. 71 71 ... ... @@ -84,17 +84,19 @@ 84 84 85 85 Steps to follow when adding an integration to the routing Part I: 86 86 87 - *Add a header in the onramp named {technicalnameofproject}\_targetSystem (if this is not done yet)88 - *Fill this header with a value that should be defined as a property (naming convention = systemname.messagetype.targetsystems)89 - *This property should be created in Test, Accp, and Prod and filled with all target systems for a certain message type (notation = systemname1,systemname2,systemname3)90 - *In the routing a standard router should be used as the first building block after receiving the input.98 +1. Add a header in the onramp named {technicalnameofproject}\_targetSystem (if this is not done yet) 99 +2. Fill this header with a value that should be defined as a property (naming convention = systemname.messagetype.targetsystems) 100 +3. This property should be created in Test, Accp, and Prod and filled with all target systems for a certain message type (notation = systemname1,systemname2,systemname3) 101 +4. In the routing a standard router should be used as the first building block after receiving the input. 91 91 92 92 Part II 93 93 94 -* In this standard router a SpelExpression has to be defined **once** that concatenates the following headers: {technicalnameofproject}\_targetSystem and {technicalnameofproject}\_messageType. 95 -* For every unique combination there is a value that should be specified alongside the channel on which to put the message (this should be a channel that ultimately leads to the correct offramp queue) 96 -* For every channel that leads to a JMS outbound channel adapter a filter needs to be added to make sure that each output option can be turned on or off easily. This to prevent that messages are sent to a system that does not expect them then 97 -* This filter should look like this: '${routing.monitor.detorem.enabled}' == 'true'. The naming convention of said property is routing.targetsystem.messagetype.enabled. 105 +5. In this standard router a SpelExpression has to be defined **once** that concatenates the following headers: {technicalnameofproject}\_targetSystem and {technicalnameofproject}\_messageType. 106 +6. For every unique combination there is a value that should be specified alongside the channel on which to put the message (this should be a channel that ultimately leads to the correct offramp queue) 107 +7. For every channel that leads to a JMS outbound channel adapter a filter needs to be added to make sure that each output option can be turned on or off easily. 108 + This to prevent that messages are sent to a system that does not expect them then 109 + 8 This filter should look like this: '${routing.monitor.detorem.enabled}' == 'true'. 110 + The naming convention of said property is routing.targetsystem.messagetype.enabled. 98 98 99 99 === 3.5 The result === 100 100 ... ... @@ -104,6 +104,7 @@ 104 104 [[image:Main.Images.Microlearning.WebHome@crashcourse-messaging-asynchronous-routing--simple-asynchronous-routing-example.png]] 105 105 106 106 120 + 107 107 == 4. Assignment == 108 108 109 109 Build your asynchronous routing based on the best practice for one of the offramps that are available within your (Academy) project. ... ... @@ -115,6 +115,8 @@ 115 115 * Control the output with a filter to prevent data to be sent to a queue too early 116 116 * Use the annotations to write down the step by step guide within your asynchronous routing 117 117 132 + 133 + 118 118 == 6. Suggested Additional Readings == 119 119 120 120 If you are interested in this topic and want more information on it please read the help text provided by eMagiz.