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
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, we will introduceyoutothebasicsof 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,76 +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 -{{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==27 +== 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"]].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 -[[image:Main.Images.Microlearning.WebHome@intermediate-key-concepts-emagiz-messaging-messaging-synchronous--concept.png]] 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) 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"]].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. 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.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: 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"]]. 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 37 37 38 - ===3.1Practical use case===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. 39 39 40 - Apractical use case in which youwouldmostlikelywant to handle yourintegration synchronouslyis thefollowinguse: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). 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).50 +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. 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) 45 45 46 -== =3.2Asynchronousvs Synchronous===57 +== 4. Assignment == 47 47 48 - The decisionto handle an integration processa specificmanner depends on various relevantbusinessand technical checks and balances that should be answered before choosing which integration pattern to choose and then subsequently which alternativemethod within an integrationpatternto choose. If you want moreinformation on how to decide thiscorrectly, 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"]].59 +No assignment accompanies this microlearning. 49 49 50 -{{html}} 51 -<!-- 61 +== 5. Key takeaways == 52 52 53 -== 4. Assignment == 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) 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. 57 57 58 ---> 59 -{{/html}} 60 60 61 -== 4.Keytakeaways ==71 +== 6. Suggested Additional Readings == 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. 73 +If you are interested in this topic, please boost your knowledge with the help of the internet. 69 69 70 -== 5. SuggestedAdditionalReadings==75 +== 7. Silent demonstration video == 71 71 72 - If you are interestedinthistopicandwantmoreinformationonit pleasereadthe helptext providedby eMagiz andreadthe following links:77 +As this is a more theoretical microlearning, we have no video for this. 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 84 ))) 85 85 86 86 ((({{toc/}}))){{/container}}