Changes for page Calling an Asynchronous Queue in Mendix
Last modified by Erik Bakker on 2025/02/28 09:50
From version 21.2
edited by Erik Bakker
on 2022/06/10 12:14
on 2022/06/10 12:14
Change comment:
Update document after refactoring.
To version 30.1
edited by Erik Bakker
on 2025/02/28 09:37
on 2025/02/28 09:37
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - intermediate-mendix-connectivity-calling-an-asynchronous-webservice-in-mendix1 +Calling an Asynchronous Queue in Mendix - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,96 +1,98 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - =Calling an asynchronouswebserviceinMendix=2 +In this microlearning, we will integrate Mendix with eMagiz using the eMagiz Mendix module. Here, we will guide you through calling a synchronous queue in Mendix, essential for efficient data exchange between your systems. 3 3 4 -With the help of the eMagiz Mendix module created by the eMagiz team, you can easily connect between Mendix and eMagiz for data integration. In this microlearning, we will focus on calling an asynchronous web service in Mendix. 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: October 29th, 2021 9 -* Required reading time: 6 minutes 10 - 11 11 == 1. Prerequisites == 12 12 13 13 * Intermediate knowledge of the eMagiz platform 14 -* Access to a Mendix application 9 +* Access to a Mendix application (potentially via an external party) 15 15 * Access to the Deploy phase of your eMagiz project 16 -* A connection between Mendix and eMagiz Designed and Created 17 -* Using eMagiz Mendix version 5.0.0 or higher. 11 +* A connection between Mendix and eMagiz Designed, Created, and in the active release 12 +* Using the "eMagiz Connector" in the Mendix Marketplace. 13 +* Initial [[installation (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.novice-mendix-connectivity-install-emagiz-mendix-connector.WebHome||target="blank"]] done. 14 +* Initial [[configuration (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.novice-mendix-connectivity-configure-emagiz-mendix-connector.WebHome||target="blank"]] done. 18 18 19 19 == 2. Key concepts == 20 20 21 -This microlearning centers around calling a nasynchronousweb servicein Mendix22 -With eMagiz MendixConnector, we mean:A Mendix module developed and maintained by eMagiz that simplifies connect a Mendix application to an eMagiz project for data traffic between both systems.18 +This microlearning centers around calling a synchronous queue in Mendix. 19 +* With eMagiz Connector, we mean A Mendix module developed and maintained by eMagiz that simplifies connecting a Mendix application to an eMagiz project for data traffic between both systems. 23 23 24 -To call a nasynchronousweb servicein Mendix, you need the following:21 +To call a synchronous queue in Mendix, you need the following: 25 25 23 +* The destination (i.e., the queue from which you want to retrieve the information) 26 26 * Execute microflow (the microflow that will process the incoming data) 27 -* Optionally, you can define an import mapping and subsequent option 25 +* Optionally, you can define an import mapping and subsequent options. 28 28 27 +{{warning}}All changes in eMagiz need to be activated by adding the changes to the eMagiz release and activating said release. When setting up the initial connection, the Mendix system must be **in** the eMagiz release before connecting from Mendix to eMagiz with an **activation key**.{{/warning}} 29 29 29 +== 3. Calling a synchronous queue in Mendix == 30 30 31 - ==3.Calling an asynchronouswebservice in Mendix==31 +With the help of the Mendix module (called eMagiz Connector) created by the eMagiz team, you can easily connect between Mendix and eMagiz for data integration. This microlearning will focus on calling a synchronous queue in Mendix. For sending data to Mendix, we offer three options to send data: 32 32 33 -With the help of the eMagiz Mendix module created by the eMagiz team, you can easily connect between Mendix and eMagiz for data integration. In this microlearning, we will focus on calling an asynchronous web service in Mendix. For sending data to Mendix, we offer two options to send data: 33 +* Using the import and export mapping to send data to Mendix. 34 +* Sending a string to and from Mendix without using the import and export mapping. 35 +* Any combination of the two above. 34 34 35 -* Using the import mapping to send data to Mendix 36 -* Sending a string message directly to Mendix 37 +Below, we will detail how to configure each option for sending data synchronously to Mendix. 37 37 38 - Alternatively,youcould usethe eMagizKafka connectortoconnect totheevent broker that eMagiz offers.Formoreinformationon that, please checkoutthis [microlearning](intermediate-event-streaming-connectors-using-kafka-module-mendix.md).39 +=== 3.1 Sending synchronous messages with import and export mapping === 39 39 40 - Below,wewilldetailhowtoconfigure eachoptionfor sending dataasynchronouslytoMendix.41 +To send data to Mendix, you must define several configuration options in the Mendix project. In this example, we will look at the configuration using the import and export mapping in Mendix. In the subsequent paragraph, we will look at configuring the exit if you do **not** want to use the import and export mapping. 41 41 42 - ===3.1Sendingasynchronousmessageswith importmapping===43 +In eMagiz, you will see a flow in Create that you cannot edit, as the autogenerated functionality provided by eMagiz is all you need. Once done, make sure the flow is transported to Deploy and ready to be used in a Mendix application by adding it to a release. 43 43 44 - To send data to Mendix, youneed to define several configuration options in the exitflow within theeMagiz portal. You wantto connect your eMagizsolutionto Mendix.In this example, we will look attheconfigurationforwhen youwanttosetheimportmapping in Mendix. In thesubsequent paragraph, wewill take a closerlook at how to configure the exit incaseyou do **not** want to use theimport mapping.45 +{{info}}The exit version must be altered when you change your system messages in Design.{{/info}} 45 45 46 - Youwillseethefollowingoverviewwithinthe exitflow, which youcanconfigure(ifin"StartEditing"mode).Here, youneed todefine theimportmapping(complete nameinMendixincluding modulename)and theexecute microflow(completenameinMendixincludingmodulename).47 +In parallel, earlier or later, the Mendix application needs to be developed to handle the message's consumption and respond to the request with a response mapping. This is done by adding the following configuration to the existing "After Startup" microflow. 47 47 48 -[[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-an-asynchronous-webservice-in-exit-flow-config.png]] 49 +==== 3.1.1 Startup action ==== 50 +In Mendix, you must add the "StartSyncMessageConsumer" Java Action to the after startup flow. The most important configuration items here are the following. 49 49 50 -When selecting the import mapping, several additional options need to be chosen within the exit. What each specific option does is detailed in the accompanying help text. Below you will see an example of how you could configure this. 52 +[[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-a-synchronous-webservice-in-mendix-start-consumer.png]] 53 + 54 +* The destination (i.e., the queue from which you want to consume the **request** messages). This can be supplied by the eMagiz developer or found under Deploy -> Mendix Connectors should you have access to the eMagiz model in question. 55 +* The export and import mapping (based on the system message definitions). These definitions can be determined by the eMagiz developer (and then shared with the Mendix developer) or determined by the Mendix developer (and then shared with the eMagiz developer). 56 +* The microflow that handles the incoming message and returns a result. 51 51 52 -[[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-a n-asynchronous-webservice-in-exit-flow-config-import-mapping-specific.png]]58 +[[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-a-synchronous-webservice-in-mendix-on-receive-microflow-config.png]] 53 53 54 - NotethattheRangeis a critical piece of the configurationasit defines whetherthe root of the result of the import mapping isa list (All), a single object (First), or a limited list (Custom). Note that theparameter of your import microflowshouldmatch thisto prevent errors. So, for example, when your parameterupon theimportmicroflow isanObject, you shouldselect the option First.If the parameter on your import microflow isaList, you should select the option All. In cases where you want to reduce the number of entries in the List, you can use the Custom optionto reduce the amount to a predefined limit.60 +=== 3.2 Sending synchronous messages without import and export mapping === 55 55 56 -W hensatisfiedwiththissetup, pleasecreate anewversionoftheflowand includeitinyourlatestrelease.ThatwillallowMendixto retrieve thenewestversion uponthenext restartofMendix(orby manuallydownloadingthereleaseinMendix).62 +We just saw the example when working with the import and export mapping. Now we turn our attention to an instance without those mappings. In these cases, the string is just passed to the execute microflow, and you can determine in Mendix yourself what to do with it. The same applies to the export part of the logic. 57 57 58 - ===3.2Sendingasynchronousmessages withoutimportmapping===64 +In eMagiz, you will see a flow in Create that you cannot edit, as the autogenerated functionality provided by eMagiz is all you need. Once done, make sure the flow is transported to Deploy and ready to be used in a Mendix application by adding it to a release. 59 59 60 - We just saw the example when working withtheimport mapping.Nowwe turnourattentiontoaninstancewithoutimportmapping. Inthesecases, thestringis justpassedto theexecute microflow,andyoucan determine inMendix yourselfwhat todo with it.66 +{{info}}The version of your exit needs to be altered when you make changes to your system messages in Design.{{/info}} 61 61 62 - Youwillsee thefollowingoverviewwithin theexitflow,whichyoucanconfigure(if in"StartEditing"mode).Hereyouneedtodefinetheexecute microflow(completenameinMendixincludingmodulename).68 +In parallel, earlier or later, the Mendix application needs to be developed to handle the consumption of the message and respond to the request with a response mapping. This is done by adding the following configuration to the existing "After Startup" microflow. 63 63 64 -[[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-an-asynchronous-webservice-in-exit-flow-config-string.png]] 70 +==== 3.1.1 Startup action ==== 71 +In Mendix, you must add the "StartSyncStringConsumer" Java Action to the after startup flow. The most important configuration items here are the following. 65 65 66 -When satisfied with this setup, please create a new version of the flow and include it in your latest release. That will allow Mendix to retrieve the newest version upon the next restart of Mendix (or by manually downloading the release in Mendix). 73 +[[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-a-synchronous-webservice-in-mendix-start-consumer-string.png]] 74 + 75 +* The destination (i.e., the queue from which you want to consume the **request** messages). This can be supplied by the eMagiz developer or found under Deploy -> Mendix Connectors should you have access to the eMagiz model in question. 76 +* The microflow that handles the incoming message and returns a result. 67 67 78 +[[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-a-synchronous-webservice-in-mendix-on-receive-microflow-config-string.png]] 68 68 80 +== 4. Key takeaways == 69 69 70 - ==4.Assignment==82 +To call a synchronous queue in Mendix, you need the following: 71 71 72 -The assignment is simple this time. Configure the exit flow to send data to Mendix correctly. Ideally, work on both options. 73 -This assignment can be completed with the help of an associated Mendix project linked to the (Academy) project that you have created/used in the previous assignment. 74 - 75 -== 5. Key takeaways == 76 - 77 -To call an asynchronous web service in Mendix, you need the following: 78 - 84 +* The destination (i.e., the queue from which you want to retrieve the information) 79 79 * Execute microflow (the microflow that will process the incoming data) 80 -* Optionally, you can define an import mapping and subsequent option 81 -* Setting the Range option correctly is critical to prevent 'unexpected' errors 86 +* Optionally, you can define an import mapping and subsequent options. 82 82 83 - Note:To make a connection in allowing data to travel between A and B, you need tofillinhe correct constantsandsetupyour KeystoreTruststorecorrectly.Formoreinformation check out this[course](novice-mendix-connectivity-index.md)88 +{{warning}} To make a connection in allowing data to travel between A and B, you need to [[install (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.novice-mendix-connectivity-install-emagiz-mendix-connector.WebHome||target="blank"]] and do a basic [[configuration (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.novice-mendix-connectivity-configure-emagiz-mendix-connector.WebHome||target="blank"]] before you can set up this specific communication.{{/warning}} 84 84 90 +== 5. Suggested Additional Readings == 85 85 92 +If you are interested in this topic and want more information, please read the release notes provided by eMagiz that accompany the eMagiz Mendix Connector version you have selected. Furthermore, check out these links: 86 86 87 -== 6. Suggested Additional Readings == 94 +* [[Novice Level (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Novice.WebHome||target="blank"]] 95 +** [[Mendix Connectivity (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.WebHome||target="blank"]] 96 +* [[Mendix Connectivity (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=%22mendix+connectivity%22||target="blank"]] 88 88 89 -If you are interested in this topic and want more information, please read the release notes provided by eMagiz that accompany the eMagiz Mendix Connector version you have selected. 90 - 91 -== 7. Silent demonstration video == 92 - 93 -We have opted not to make a video on this for now. 94 -The pictures and text provided above should give you enough guidance to configure the connection between Mendix and eMagiz. 95 - 96 96 )))((({{toc/}}))){{/container}}{{/container}}