Changes for page Asynchronous Routing
Last modified by Danniar Firdausy on 2024/09/04 09:01
From version 37.10
edited by Danniar Firdausy
on 2024/08/21 16:03
on 2024/08/21 16:03
Change comment:
There is no comment for this version
To version 17.2
edited by Erik Bakker
on 2022/06/13 11:19
on 2022/06/13 11:19
Change comment:
Update document after refactoring.
Summary
-
Page properties (4 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - AsynchronousRouting1 +crashcourse-messaging-asynchronous-routing - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. dfirdausy1 +XWiki.ebakker - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Content
-
... ... @@ -1,8 +1,13 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - Inthismicrolearning, we will dive into the essentials of asynchronousroutingand its importance in managing message distribution within the five-layer messaging model. We will cover the key concepts, including how to route messages efficiently and manage output control.2 += Asynchronous Routing = 3 3 4 -I fyouhave anyquestionsalong theway,feelfreetoreachouttousat[[academy@emagiz.com>>mailto:academy@emagiz.com]].4 +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. 5 5 6 +Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 7 + 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 ... ... @@ -10,16 +10,26 @@ 10 10 == 2. Key concepts == 11 11 12 12 This microlearning centers around asynchronous routing for messaging flows in eMagiz. 13 - *Withasynchronous routing we mean: The process that routes messages that it receives to the correct outbound queue based on some metadata.18 +By asynchronous routing we mean: The process that routes messages that it receives to the correct outbound queue based on some metadata. 14 14 20 +The asynchronous routing has three relevant parts: 21 + 22 +* All asynchronous onramps send their data to the routing 23 +* Based on a decision made within the routing the message is routed to one or more offramp queues 24 +* Each offramp queue will receive data based on the decision unless you add another filter before the messages are sent to the offramp queue 25 + 26 + 27 + 15 15 == 3. Asynchronous routing == 16 16 17 -Asynchronous routing plays a crucial role in the distribution of messages it receives to one or more offramps. In eMagiz, the asynchronous routing has three relevant parts:30 +Asynchronous routing plays a crucial role in the distribution of messages it receives to one or more offramps. 18 18 19 -* All asynchronous onramps that send data to the routing. 20 -* Based on a decision made within the routing the message is routed to one or more offramp queues. 21 -* Each offramp queue will receive data based on the decision unless you add another filter before the messages are sent to the offramp queue. 32 +The asynchronous routing has three relevant parts: 22 22 34 +* All asynchronous onramps send their data to the routing 35 +* Based on a decision made within the routing the message is routed to one or more offramp queues 36 +* Each offramp queue will receive data based on the decision unless you add another filter before the messages are sent to the offramp queue 37 + 23 23 === 3.1 Make a decision === 24 24 25 25 In asynchronous routing, you can build your decision model on which the routing needs to make the decision. ... ... @@ -27,17 +27,13 @@ 27 27 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. 28 28 The SpEL expression looks as follows: 29 29 30 -{{code language="xml"}} 31 - 32 32 headers.{technicalnameofproject}\_targetSystem.split(',').![#this.trim()+#root.headers.{technicalnameofproject}_messageType] 33 33 34 -{{/code}} 35 - 36 36 This SpEL expression does the following things: 37 37 38 - *It looks for the header called {technicalnameofproject}\_targetSystem and will split each entry based on the separator (a comma)39 - *It will trim the result of this split and combine it the value in the header called {technicalnameofproject}\_messageType40 - *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 41 41 42 42 In the standard router component this will look as follows: 43 43 ... ... @@ -56,10 +56,16 @@ 56 56 57 57 === 3.2 Control output === 58 58 59 -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. 60 60 61 -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. 62 -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. 63 63 64 64 Below you see how this will look on flow level. 65 65 ... ... @@ -78,17 +78,19 @@ 78 78 79 79 Steps to follow when adding an integration to the routing Part I: 80 80 81 - *Add a header in the onramp named {technicalnameofproject}\_targetSystem (if this is not done yet)82 - *Fill this header with a value that should be defined as a property (naming convention = systemname.messagetype.targetsystems)83 - *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)84 - *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. 85 85 86 86 Part II 87 87 88 -* In this standard router a SpelExpression has to be defined **once** that concatenates the following headers: {technicalnameofproject}\_targetSystem and {technicalnameofproject}\_messageType. 89 -* 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) 90 -* 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 91 -* 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. 92 92 93 93 === 3.5 The result === 94 94 ... ... @@ -98,21 +98,28 @@ 98 98 [[image:Main.Images.Microlearning.WebHome@crashcourse-messaging-asynchronous-routing--simple-asynchronous-routing-example.png]] 99 99 100 100 101 -== 4. Key takeaways == 102 102 121 +== 4. Assignment == 122 + 123 +Build your asynchronous routing based on the best practice for one of the offramps that are available within your (Academy) project. 124 +This assignment can be completed with the help of your (Academy) project you have created/used in the previous assignment. 125 + 126 +== 5. Key takeaways == 127 + 103 103 * Use one component that decides to route messages to certain channels 104 104 * Control the output with a filter to prevent data to be sent to a queue too early 105 105 * Use the annotations to write down the step by step guide within your asynchronous routing 106 106 107 -== 5. Suggested Additional Readings == 108 108 109 -If you are interested in this topic and want more information on it please read the help text provided by eMagiz and read the following link: 110 110 111 -* [[Store (Menu)>>doc:Main.eMagiz Store.WebHome||target="blank"]] 112 -** [[Accelerators (Navigation)>>doc:Main.eMagiz Store.Accelerators.WebHome||target="blank"]] 113 -*** [[Routing - SpEL (Store Item)>>doc:Main.eMagiz Store.Accelerators.Routing - SpEL.WebHome||target="blank"]] 114 -* [[Intermediate Level (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.WebHome||target="blank"]] 115 -** [[Data traffic routing (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Data traffic routing.WebHome||target="blank"]] 116 -*** [[Synchronous routing (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Data traffic routing.intermediate-data-traffic-routing-synchronous-routing||target="blank"]] 117 -* [[Asynchronous Routing (Search Results)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=0%2FMain.&l_space_facet=10&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=%22asynchronous+routing%22||target="blank"]] 134 +== 6. Suggested Additional Readings == 135 + 136 +If you are interested in this topic and want more information on it please read the help text provided by eMagiz. 137 + 138 +== 7. Silent demonstration video == 139 + 140 +This video demonstrates how you could have handled the assignment and gives you some context on what you have just learned. 141 + 142 +{{video attachment="crashcourse-messaging-asynchronous-routing.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 143 + 118 118 )))((({{toc/}}))){{/container}}{{/container}}