Changes for page Messaging Synchronous
Last modified by Danniar Firdausy on 2024/09/16 13:37
From version 13.11
edited by Danniar Firdausy
on 2024/09/16 13:33
on 2024/09/16 13:33
Change comment:
There is no comment for this version
To version 3.2
edited by Erik Bakker
on 2022/08/23 09:57
on 2022/08/23 09:57
Change comment:
Update document after refactoring.
Summary
-
Page properties (4 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - MessagingSynchronous1 +intermediate-key-concepts-emagiz-messaging-messaging-synchronous - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. dfirdausy1 +XWiki.ebakker - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Content
-
... ... @@ -1,10 +1,13 @@ 1 1 {{container}} 2 2 {{container layoutStyle="columns"}} 3 3 ((( 4 -In this microlearning session, we willintroduceyoutothebasicsof thesynchronous messaging patternwithin the eMagizplatform. You willgainanunderstanding ofhow this patternoperates,its keycharacteristics,andwhen it mayor may notbe thebestchoiceforyour integrations.4 +In this microlearning, we will explore what the function of the entry is within the message engine. Furthermore, we will explain why there is no entry queue. 5 5 6 6 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 7 7 8 +* Last update: August 5th, 2021 9 +* Required reading time: 5 minutes 10 + 8 8 == 1. Prerequisites == 9 9 10 10 * Intermediate knowledge of the eMagiz platform ... ... @@ -11,83 +11,68 @@ 11 11 12 12 == 2. Key concepts == 13 13 14 -This microlearning centers around the synchronous messaging pattern in eMagiz. 15 -By synchronous, we mean The process that processes data and subsequently informs the caller what the status is. 17 +This microlearning centers on the concept of entry, not a queue. 16 16 17 -Key characteristics of synchronous messaging are: 19 +* The key aspects are: 20 + * Entry is the starting point of the integration process in messaging 21 + * Queues are an internal resource of eMagiz 22 + * Outside parties are not allowed to write on eMagiz queues directly 23 + * eMagiz facilitates various connectivity methods (i.e., REST, SOAP, Database, File) 18 18 19 -* Blocking. The sender initiates the process and waits for a response before continuing with the following message 20 -* Systems depend on the responses of other systems for their function 21 -* Messages have a time limit. The response needs to be back within 25 seconds (eMagiz default) 22 -* Uses a request-response structure that talks to one system at a time 23 23 24 -== 3. Messaging Synchronous == 25 25 26 - Synchronousmessaging is the less used, the less advised option when implementing a messaging integration via eMagiz.Incase you wantto learn more about asynchronous messaging,please checkoutthis [[microlearning>>doc:Main.eMagizAcademy.Microlearnings.Crash Course.Crash CourseMessaging.crashcourse-messaging-messaging-asynchronous||target="blank"]].27 +== 3. Entry, not a queue == 27 27 28 - Keycharacteristicsofsynchronous messaging are:29 +In this microlearning, we will explore what the function of the entry is within the message engine. Furthermore, we will explain why there is no entry queue. 29 29 30 -* Blocking. The sender initiates the process and waits for a response before continuing with the following message 31 -* Systems depend on the responses of other systems for their function 32 -* Messages have a time limit. The response needs to be back within 25 seconds (eMagiz default) 33 -* Uses a request-response structure that talks to one system at a time 31 +* The key aspects are: 32 + * Entry is the starting point of the integration process in messaging 33 + * Queues are an internal resource of eMagiz 34 + * Outside parties are not allowed to write on eMagiz queues directly 35 + * eMagiz facilitates various connectivity methods (i.e., REST, SOAP, Database, File) 34 34 35 - With thismethod,thesending partysuppliesthedata to eMagizviaa push mechanism.eMagiz,in turn,placesthe dataon a queue (inmostcasesonramp queue). The subsequentprocess(the onramp)will processthemessage and will putthemessageonthenext queue (the synchronousrouting). That processwillrouteeach messagetothecorrectofframp. Thisprocesscontinues untilthemessageeMagiz delivers to the external system.Atthat point,eMagizwillwaitfora response.If thatresponseisreceived,themessagewill travelbackto thestarting pointtodeliverthereaction tothecaller.Ifsomething goeswrong, for example,a timeout,theerrormessageis alsogiven backto the caller,andeMagiz willlog the exception. Ifyouwant tolearn moreonthat,pleasecheckout this[[microlearning>>doc:Main.eMagiz Academy.Microlearnings.IntermediateLevel.UnderstandingErrorHandling.intermediate-understanding-error-handling-in-emagiz-messaging-synchronous||target="blank"]].37 +As you learned from the introductory course on messaging, we use a five-layer approach to handle data within the messaging engine. The first layer the data encounters is the entry. The goal of the entry is twofold. One is to establish a connection with an external system. The other is to place data on a queue. There are two ways to establish connectivity. The first method is via a pull mechanism. This pull mechanism means that eMagiz will initiate the communication to retrieve data. The second method is a push mechanism. This push mechanism means that eMagiz will patiently wait till the external system offers data to eMagiz. The push mechanism will typically be realized with the help of a hosted web service (REST or SOAP) within your eMagiz solution. 36 36 37 - [[image:Main.Images.Microlearning.WebHome@intermediate-key-concepts-emagiz-messaging-messaging-synchronous--concept.png]]39 +Since the goal of the entry is connectivity between the external system and eMagiz, you could argue that it would be easy to let them place the data on the queue. However, things are not that easy. There are several reasons why this is not a best practice: 38 38 39 -Note that this means that when one message is currently being processed, all other messages have to patiently wait until the message is processed as we speak delivered back to the caller. As there is a time constraint on the messages (25 seconds as eMagiz default), you can see why this option is less suitable within the messaging engine. The most pain is felt in the routing. Just as with asynchronous routing, the synchronous routing processes all synchronous messages that pass through your messaging engine. As a result, this means that when one synchronous process is busy, it can even hold up other synchronous processes. The API Gateway pattern is a more suitable alternative for handling the request-response pattern via an integration platform such as eMagiz. If you want to learn more on that, please check out the [[crash course>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.WebHome||target="blank"]]. 41 +* This would mean that the external system directly needs to connect to the infra layer (the JMS) and will have the option to read and write on other queues as well 42 +* This would mean that the external system can only push data to eMagiz (so no polling of data) 43 +* This would mean that the external system can directly place data on a queue 44 +* This would create a tightly coupled dependency between the external system and eMagiz 40 40 41 - Anotheraspectof thesynchronousmessaging patterntoconsideristhat thesystem from which you wantoretrievedata(or pushdata to)basedontherequestmadebythecallerneedstobeonline.Ifit isnot online,eMagizwon'treceive aresponse,andthecallercannotcontinuetheirwork. Thisfact createsdependency betweensystemsthat could reduce theperceivedreliabilityof your integrationsolution.Withasynchronousmessaging, youcouldtake measurestomitigatetheserisks, such as a retrymechanism.46 +The above arguments concluded that the connectivity between eMagiz and the external system and the internal queue mechanism of eMagiz should be considered two separate things. This conclusion did raise a question on how eMagiz can guarantee message delivery. The messaging engine uses queues to ensure message delivery. But what if the first queue (the onramp queue) cannot be reached? What happens then. 42 42 43 - A third aspecttoconsideriswhetheryouan set agenericpointof entrythroughwhichall clients can communicateviaeMagiztomanyothersystems.Inthosecases,youcouldlookattheAPIGateway solutionasan alternative tosynchronousmessaging,asitcomeswithseveralbenefits.More onthebasicsof theAPIGatewaycanbefoundinthis [[crash course>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.CrashCourseAPI Gateway.WebHome||target="blank"]].48 +The H2 database is introduced to safeguard against any problems within the entry. This component is generated in every entry in eMagiz. This H2 database will temporarily store data and act as a bridge between the entry and the onramp queue. This way, eMagiz can guarantee message delivery. If you want to learn more about the function of the H2 database, please check out this [microlearning](intermediate-solution-architecture-function-of-h2-database.md). 44 44 45 - ===3.1 Practical usecase ===50 +To summarize: 46 46 47 -A practical use case in which you would most likely want to handle your integration synchronously is the following use case: 52 +* Entry is the starting point of the integration process in messaging 53 +* Queues are an internal resource of eMagiz 54 +* Outside parties are not allowed to write on eMagiz queues directly 55 +* eMagiz facilitates various connectivity methods (i.e., REST, SOAP, Database, File) 48 48 49 - Imagineyou want to order something at a webshop. After you haveselected the product(s), you want to open the payment process to pay. Upon payment, you also need to supply the relevant addressinformation, so the webshop knows where to deliver the product. In doingso, you oftensee that when you provide your postal code (and house number), the system will automatically fill inheremainder of your address information. This functionality is there for two reasons. Your convenience and because the webshop needs this information to deliver the product you paid for correctly. If the webshop does not know where to deliver the product, the webshop cannot complete the order process. As a result, the webshop needs to send out a request that will promptly be followed by a response (a synchronous call).57 +== 4. Assignment == 50 50 51 - Even in this scenario,most webshops give the user the optiontomanually fill in theremainder oftheinformation as they know that even when thecall fails, the user still needs a way tocontinue. So in asense,the webshophas taken theresponsibility of handling successand failure responses.59 +No assignment accompanies this microlearning. 52 52 53 -== =3.2Asynchronousvs Synchronous ===61 +== 5. Key takeaways == 54 54 55 -The decision to handle an integration process in a specific manner depends on various relevant business and technical checks and balances that should be answered before choosing which integration pattern to choose and then subsequently which alternative method within an integration pattern to choose. If you want more information on how to decide this correctly, please check out this [[microlearning>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Discover your integration landscape.intermediate-discover-your-integration-landscape-determining-integration-pattern||target="blank"]]. 63 +* The key aspects are: 64 + * Entry is the starting point of the integration process in messaging 65 + * Queues are an internal resource of eMagiz 66 + * Outside parties are not allowed to write on eMagiz queues directly 67 + * eMagiz facilitates various connectivity methods (i.e., REST, SOAP, Database, File) 56 56 57 -{{html}} 58 -<!-- 59 59 60 -== 4. Assignment == 61 61 62 -Analyze a synchronous messaging flow from entry to exit and learn what happens within this process. 63 -This assignment can be completed with the help of your (Academy) project you have created/used in the previous assignment. 71 +== 6. Suggested Additional Readings == 64 64 65 ---> 66 -{{/html}} 73 +If you are interested in this topic, please boost your knowledge with the help of the internet. 67 67 68 -== 4.Keytakeaways==75 +== 7. Silent demonstration video == 69 69 70 -* Key characteristics of synchronous messaging include: 71 -** Blocking: The sender must wait for a response before proceeding with the next message. 72 -** System dependency: Systems rely on timely responses from others to function effectively. 73 -** Time constraints: Messages have a time limit (25 seconds by default in eMagiz) for receiving a response. 74 -** Request-response structure: Each request is handled by one system at a time. 75 -* The API Gateway pattern is often a better alternative when handling synchronous communication, as it offers more flexibility and mitigates some of the challenges associated with synchronous messaging. 77 +As this is a more theoretical microlearning, we have no video for this. 76 76 77 -== 5. Suggested Additional Readings == 78 - 79 -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 links: 80 - 81 -* [[Crash Course (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.WebHome||target="blank"]] 82 -** [[Crash Course Messaging (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Messaging.WebHome||target="blank"]] 83 -*** [[Messaging Asynchronous (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Messaging.crashcourse-messaging-messaging-asynchronous||target="blank"]] 84 -** [[Crash Course API Gateway (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.WebHome||target="blank"]] 85 -* [[Intermediate Level (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.WebHome||target="blank"]] 86 -** [[Discover your integration landscape (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Discover your integration landscape.WebHome||target="blank"]] 87 -*** [[Determining Integration Pattern (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Discover your integration landscape.intermediate-discover-your-integration-landscape-determining-integration-pattern||target="blank"]] 88 -** [[Understanding Error Handling (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Understanding Error Handling.WebHome||target="blank"]] 89 -*** [[Error Handling in Messaging Synchronous (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Understanding Error Handling.intermediate-understanding-error-handling-in-emagiz-messaging-synchronous||target="blank"]] 90 -* [[Messaging Synchronous (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=%22messaging+synchronous%22||target="blank"]] 91 91 ))) 92 92 93 93 ((({{toc/}}))){{/container}}