Changes for page Messaging Synchronous
Last modified by Danniar Firdausy on 2024/09/16 13:37
From version 13.14
edited by Danniar Firdausy
on 2024/09/16 13:37
on 2024/09/16 13:37
Change comment:
There is no comment for this version
Summary
-
Page properties (5 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,0 @@ 1 -Messaging Synchronous - Parent
-
... ... @@ -1,1 +1,0 @@ 1 -Main.eMagiz Academy.Microlearnings.Intermediate Level.Key concepts eMagiz Messaging.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. dfirdausy1 +XWiki.marijn - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Content
-
... ... @@ -1,10 +1,20 @@ 1 -{{container}} 2 -{{container layoutStyle="columns"}} 3 -((( 4 -In this microlearning, we will introduce you to the basics of the synchronous messaging pattern within the eMagiz platform. You will gain an understanding of how this pattern operates, its key characteristics, and when it may or may not be the best choice for your integrations. 1 +{{html wiki="true"}} 2 +<div class="ez-academy"> 3 + <div class="ez-academy_body"> 5 5 6 - Shouldyou haveany questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]].5 +<div class="doc"> 7 7 7 + 8 + 9 += Entry, not a queue = 10 + 11 +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. 12 + 13 +Should you have any questions, please get in touch with academy@emagiz.com. 14 + 15 +* Last update: August 5th, 2021 16 +* Required reading time: 5 minutes 17 + 8 8 == 1. Prerequisites == 9 9 10 10 * Intermediate knowledge of the eMagiz platform ... ... @@ -11,77 +11,73 @@ 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. 24 +This microlearning centers on the concept of entry, not a queue. 16 16 17 -Key characteristics of synchronous messaging are: 26 +* The key aspects are: 27 + * Entry is the starting point of the integration process in messaging 28 + * Queues are an internal resource of eMagiz 29 + * Outside parties are not allowed to write on eMagiz queues directly 30 + * 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 -{{info}}In case you want to learn more about asynchronous messaging, please check out this [[microlearning>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Messaging.crashcourse-messaging-messaging-asynchronous||target="blank"]].{{/info}} 25 25 26 -== 3. Messaging Synchronous==34 +== 3. Entry, not a queue == 27 27 28 - Synchronousmessaging isthe less used, the less advisedoption when implementing a messaging integration viaeMagiz. With this approach, the sendingparty supplies the data to eMagiz via a push mechanism. eMagiz,in turn, places the data on a queue (in most cases an onramp queue). The subsequent process (the onramp)will processthe message andwillput themessage on the next queue (the synchronous routing). Thatprocess will routeeachmessagetothe correctofframp. This process continuesuntil the message eMagiz delivers to the external system.At that point,eMagizwill waitfor a response. If that responseis received,the messagewill travel back to the startingpoint to deliverthereaction to thecaller. If something goes wrong, forexample,a timeout,the error message is also given back to the caller, and eMagizwilllog theexception. If you want tolearnmore on that,please check outthis [[microlearning>>doc:Main.eMagizAcademy.Microlearnings.IntermediateLevel.Understanding ErrorHandling.intermediate-understanding-error-handling-in-emagiz-messaging-synchronous||target="blank"]].36 +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 -[[image:Main.Images.Microlearning.WebHome@intermediate-key-concepts-emagiz-messaging-messaging-synchronous--concept.png]] 38 +* The key aspects are: 39 + * Entry is the starting point of the integration process in messaging 40 + * Queues are an internal resource of eMagiz 41 + * Outside parties are not allowed to write on eMagiz queues directly 42 + * eMagiz facilitates various connectivity methods (i.e., REST, SOAP, Database, File) 31 31 32 - Notethatthis meansthatwhenonemessageis currently beingprocessed,allother messageshavetopatientlywaituntilthe messageisprocessedas we speakdeliveredbacktothealler.As thereisa timeconstrainton themessages(25secondsaseMagizdefault),you canseewhythisoptionislesssuitablewithinthe messagingengine. Themostpain isfeltnthe routing.Justaswithasynchronousrouting,thesynchronousrouting processesallsynchronous messages thatpass through your messagingengine. As a result,this meansthatwhenone synchronousprocess is busy, itcanevenholdup othersynchronous processes. TheAPIGatewaypatternis amoresuitablealternativefor handlingtherequest-responsepatternviaan integrationplatformsuch aseMagiz.Ifyouwanttolearnmoreon that, pleasecheckoutthe[[crashcourse>>doc:Main.eMagizAcademy.Microlearnings.CrashCourse.CrashCourseAPIGateway.WebHome||target="blank"]].44 +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. 33 33 34 - Anotheraspectof thesynchronous messaging patterntoconsideristhatthe systemfromwhichyouwant to retrievedata (or pushdatato)basedon the request madeby thecaller needs tobe online. If itis notonline,eMagiz won'treceivearesponse,andthecaller cannot continuetheirwork. Thisfact createsa dependency betweensystems thatcould reducetheperceivedreliabilityof yourintegrationsolution.Withasynchronousmessaging,you couldtakemeasurestomitigate these risks, such as a retry mechanism.46 +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: 35 35 36 -A third aspect to consider is whether you can set a generic point of entry through which all clients can communicate via eMagiz to many other systems. In those cases, you could look at the API Gateway solution as an alternative to synchronous messaging, as it comes with several benefits. More on the basics of the API Gateway can be found in this [[crash course>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.WebHome||target="blank"]]. 48 +* 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 49 +* This would mean that the external system can only push data to eMagiz (so no polling of data) 50 +* This would mean that the external system can directly place data on a queue 51 +* This would create a tightly coupled dependency between the external system and eMagiz 37 37 38 - ===3.1Practical use case===53 +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. 39 39 40 - Apractical use case in which youwouldmostlikelywant to handle yourintegration synchronouslyis thefollowinguse:55 +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). 41 41 42 - Imagine you want to order something at a webshop. After you have selected the product(s), you want to open the payment process to pay. Upon payment, you also need to supply the relevant address information, so the webshop knows where to deliver the product. In doing so, you often see that when you provide your postal code (and house number), the system will automatically fill in the remainder of your address information.This functionalityisthere 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. Asaesult, the webshop needs to send out a request that will promptly befollowed by a response (a synchronous call).57 +To summarize: 43 43 44 -Even in this scenario, most web shops give the user the option to manually fill in the remainder of the information as they know that even when the call fails, the user still needs a way to continue. So in a sense, the webshop has taken the responsibility of handling success and failure responses. 59 +* Entry is the starting point of the integration process in messaging 60 +* Queues are an internal resource of eMagiz 61 +* Outside parties are not allowed to write on eMagiz queues directly 62 +* eMagiz facilitates various connectivity methods (i.e., REST, SOAP, Database, File) 45 45 46 -=== 3.2 Asynchronous vs Synchronous===64 +===== Practice ===== 47 47 48 - Thedecision 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.eMagizAcademy.Microlearnings.Intermediate Level.Discover yourintegrationlandscape.intermediate-discover-your-integration-landscape-determining-integration-pattern||target="blank"]].66 +== 4. Assignment == 49 49 50 -{{html}} 51 -<!-- 68 +No assignment accompanies this microlearning. 52 52 53 -== 4.Assignment ==70 +== 5. Key takeaways == 54 54 55 -Analyze a synchronous messaging flow from entry to exit and learn what happens within this process. 56 -This assignment can be completed with the help of your (Academy) project you have created/used in the previous assignment. 72 +* The key aspects are: 73 + * Entry is the starting point of the integration process in messaging 74 + * Queues are an internal resource of eMagiz 75 + * Outside parties are not allowed to write on eMagiz queues directly 76 + * eMagiz facilitates various connectivity methods (i.e., REST, SOAP, Database, File) 57 57 58 ---> 59 -{{/html}} 60 60 61 -== 4. Key takeaways == 62 62 63 -* Key characteristics of synchronous messaging include: 64 -** Blocking: The sender must wait for a response before proceeding with the next message. 65 -** System dependency: Systems rely on timely responses from others to function effectively. 66 -** Time constraints: Messages have a time limit (25 seconds by default in eMagiz) for receiving a response. 67 -** Request-response structure: Each request is handled by one system at a time. 68 -* 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. 80 +== 6. Suggested Additional Readings == 69 69 70 - ==5. SuggestedAdditionalReadings==82 +If you are interested in this topic, please boost your knowledge with the help of the internet. 71 71 72 - Ifyouareinterested inhistopic andwantmore informationon it please read the help text provided by eMagiz and read the followinglinks:84 +== 7. Silent demonstration video == 73 73 74 -* [[Crash Course (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.WebHome||target="blank"]] 75 -** [[Crash Course Messaging (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Messaging.WebHome||target="blank"]] 76 -*** [[Messaging Asynchronous (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Messaging.crashcourse-messaging-messaging-asynchronous||target="blank"]] 77 -** [[Crash Course API Gateway (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.WebHome||target="blank"]] 78 -* [[Intermediate Level (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.WebHome||target="blank"]] 79 -** [[Discover your integration landscape (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Discover your integration landscape.WebHome||target="blank"]] 80 -*** [[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"]] 81 -** [[Understanding Error Handling (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Understanding Error Handling.WebHome||target="blank"]] 82 -*** [[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"]] 83 -* [[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"]] 84 -))) 86 +As this is a more theoretical microlearning, we have no video for this. 85 85 86 -((({{toc/}}))){{/container}} 87 -{{/container}} 88 +</div> 89 + 90 +</div> 91 +</div> 92 + 93 +{{/html}}