Changes for page Calling an Asynchronous Queue in Mendix
Last modified by Erik Bakker on 2025/02/28 09:50
From 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 (5 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,0 @@ 1 -Calling an Asynchronous Queue in Mendix - Parent
-
... ... @@ -1,1 +1,0 @@ 1 -WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ebakker1 +XWiki.marijn - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Content
-
... ... @@ -1,98 +1,108 @@ 1 -{{container}}{{container layoutStyle="columns"}}((( 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. 1 +{{html wiki="true"}} 2 +<div class="ez-academy"> 3 + <div class="ez-academy_body"> 3 3 4 - Shouldyou haveany questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]].5 +<div class="doc"> 5 5 7 + 8 + 9 += Calling an asynchronous web service in Mendix = 10 + 11 +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. 12 + 13 +Should you have any questions, please get in touch with academy@emagiz.com. 14 + 15 +* Last update: October 29th, 2021 16 +* Required reading time: 6 minutes 17 + 6 6 == 1. Prerequisites == 7 7 8 8 * Intermediate knowledge of the eMagiz platform 9 -* Access to a Mendix application (potentially via an external party)21 +* Access to a Mendix application 10 10 * Access to the Deploy phase of your eMagiz project 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. 23 +* A connection between Mendix and eMagiz Designed and Created 24 +* Using eMagiz Mendix version 5.0.0 or higher. 15 15 16 16 == 2. Key concepts == 17 17 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 connectinga Mendix application to an eMagiz project for data traffic between both systems.28 +This microlearning centers around calling an asynchronous web service in Mendix 29 +With eMagiz Mendix Connector, 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. 20 20 21 -To call a synchronous queue in Mendix, you need the following:31 +To call an asynchronous web service in Mendix, you need the following: 22 22 23 -* The destination (i.e., the queue from which you want to retrieve the information) 24 24 * Execute microflow (the microflow that will process the incoming data) 25 -* Optionally, you can define an import mapping and subsequent option s.34 +* Optionally, you can define an import mapping and subsequent option 26 26 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}} 28 28 29 -== 3. Calling a synchronous queue in Mendix == 30 30 31 - Withthehelp of the Mendix module (called eMagizConnector) created by the eMagiz team, you can easily connect between Mendix and eMagiz for data integration. This microlearningwill focus on callingaqueuein Mendix. Forsendingdata toMendix,we offer three options to send data:38 +== 3. Calling an asynchronous web service in Mendix == 32 32 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. 40 +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: 36 36 37 -Below, we will detail how to configure each option for sending data synchronously to Mendix. 42 +* Using the import mapping to send data to Mendix 43 +* Sending a string message directly to Mendix 38 38 39 - === 3.1 Sendingsynchronousmessageswith importandexport mapping===45 +Alternatively, you could use the eMagiz Kafka connector to connect to the event broker that eMagiz offers. For more information on that, please check out this [microlearning](intermediate-event-streaming-connectors-using-kafka-module-mendix.md). 40 40 41 - To send data toMendix,you must defineseveralconfiguration options in the Mendix project. In this example, we willlookattheconfigurationusing theimportandexportmapping in Mendix. Inthe subsequent paragraph,we will lookatconfiguring the exit if you do **not** want tousethe importandexport mapping.47 +Below, we will detail how to configure each option for sending data asynchronously to Mendix. 42 42 43 - IneMagiz,you will see a flow inCreate that you cannot edit,asthe autogenerated functionality provided by eMagiz isall you need. Once done,makeure theflowis transportedto Deployand ready to be used in a Mendix applicationby addingit to a release.49 +=== 3.1 Sending asynchronous messages with import mapping === 44 44 45 - {{info}}The exitversionmustbe alteredwhen youchangeyoursystem messagesinDesign.{{/info}}51 +To send data to Mendix, you need to define several configuration options in the exit flow within the eMagiz portal. You want to connect your eMagiz solution to Mendix. In this example, we will look at the configuration for when you want to use the import mapping in Mendix. In the subsequent paragraph, we will take a closer look at how to configure the exit in case you do **not** want to use the import mapping. 46 46 47 - Inparallel,earlierorlater,theMendixapplicationneedstobedevelopedto handlethe message'sconsumptionand respond totherequestwitha responsemapping.Thisisdonebyaddingthefollowingconfigurationto theexisting"AfterStartup"microflow.53 +You will see the following overview within the exit flow, which you can configure (if in "Start Editing" mode). Here, you need to define the import mapping (complete name in Mendix including module name) and the execute microflow (complete name in Mendix including module name). 48 48 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. 55 +<p align="center">[[image:intermediate-mendix-connectivity-calling-an-asynchronous-webservice-in-exit-flow-config.png||]]</p> 51 51 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. 57 +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. 57 57 58 - [[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-a-synchronous-webservice-in-mendix-on-receive-microflow-config.png]]59 +<p align="center">[[image:intermediate-mendix-connectivity-calling-an-asynchronous-webservice-in-exit-flow-config-import-mapping-specific.png||]]</p> 59 59 60 - ===3.2Sending synchronousmessages without import and export mapping===61 +Note that the Range is a critical piece of the configuration as it defines whether the root of the result of the import mapping is a list (All), a single object (First), or a limited list (Custom). Note that the parameter of your import microflow should match this to prevent errors. So, for example, when your parameter upon the import microflow is an Object, you should select the option First. If the parameter on your import microflow is a List, 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 option to reduce the amount to a predefined limit. 61 61 62 -We justaw theexamplewhenworkingwiththeimportandexport mapping. Now we turn our attentiontoan instancewithoutthosemappings.In thesecases,the stringis justpassed to the executemicroflow, and you can determineinMendixyourselfwhattodothit. Thesameappliesto theexportpart of thelogic.63 +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). 63 63 64 - IneMagiz,you will see a flow inCreate that you cannot edit,asthe autogenerated functionality provided by eMagiz isall you need. Once done,makeurethe flowstransportedto Deploy andreadytobe used inaMendix applicationby addingit to a release.65 +=== 3.2 Sending asynchronous messages without import mapping === 65 65 66 - {{info}}Theversion ofyour exit needs tobealteredwhenyoumakechangesto yoursystemmessagesinDesign.{{/info}}67 +We just saw the example when working with the import mapping. Now we turn our attention to an instance without import mapping. In these cases, the string is just passed to the execute microflow, and you can determine in Mendix yourself what to do with it. 67 67 68 - Inparallel,earlieror later, theMendix applicationneeds tobedevelopedtohandletheconsumptionofthemessageandrespond to therequestwitha responsemapping.Thisis donebyaddingthefollowingconfigurationto theexisting"AfterStartup"microflow.69 +You will see the following overview within the exit flow, which you can configure (if in "Start Editing" mode). Here you need to define the execute microflow (complete name in Mendix including module name). 69 69 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. 71 +<p align="center">[[image:intermediate-mendix-connectivity-calling-an-asynchronous-webservice-in-exit-flow-config-string.png||]]</p> 72 72 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. 73 +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). 77 77 78 - [[image:Main.Images.Microlearning.WebHome@intermediate-mendix-connectivity-calling-a-synchronous-webservice-in-mendix-on-receive-microflow-config-string.png]]75 +===== Practice ===== 79 79 80 -== 4. Keytakeaways==77 +== 4. Assignment == 81 81 82 -To call a synchronous queue in Mendix, you need the following: 79 +The assignment is simple this time. Configure the exit flow to send data to Mendix correctly. Ideally, work on both options. 80 +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. 83 83 84 -* The destination (i.e., the queue from which you want to retrieve the information) 82 +== 5. Key takeaways == 83 + 84 +To call an asynchronous web service in Mendix, you need the following: 85 + 85 85 * Execute microflow (the microflow that will process the incoming data) 86 -* Optionally, you can define an import mapping and subsequent options. 87 +* Optionally, you can define an import mapping and subsequent option 88 +* Setting the Range option correctly is critical to prevent 'unexpected' errors 87 87 88 - {{warning}}To make a connection in allowing data to travel between A and B, you need to[[install(Explanation)>>doc:Main.eMagizAcademy.Microlearnings.Novice.MendixConnectivity.novice-mendix-connectivity-install-emagiz-mendix-connector.WebHome||target="blank"]]anddoa basic [[configuration(Explanation)>>doc:Main.eMagizAcademy.Microlearnings.Novice.Mendix Connectivity.novice-mendix-connectivity-configure-emagiz-mendix-connector.WebHome||target="blank"]] before you can set up this specific communication.{{/warning}}90 +Note: To make a connection in allowing data to travel between A and B, you need to fill in the correct constants and set up your Keystore and Truststore correctly. For more information check out this [course](novice-mendix-connectivity-index.md) 89 89 90 -== 5. Suggested Additional Readings == 91 91 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: 93 93 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"]] 94 +== 6. Suggested Additional Readings == 97 97 98 -)))((({{toc/}}))){{/container}}{{/container}} 96 +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. 97 + 98 +== 7. Silent demonstration video == 99 + 100 +We have opted not to make a video on this for now. 101 +The pictures and text provided above should give you enough guidance to configure the connection between Mendix and eMagiz. 102 + 103 +</div> 104 + 105 +</div> 106 +</div> 107 + 108 +{{/html}}