Communication between models

Last modified by Eva Torken on 2023/12/07 15:01

When your integration landscape grows through time, you might decide to split functional business processes into multiple eMagiz models. In those cases, the question of connecting these models easily, stable, and securely could arise. This microlearning will focus on that question and provide an answer based on our vision and best practices when dealing with the platform.

Should you have any questions, please get in touch with academy@emagiz.com.

1. Prerequisites

  • Expert knowledge of the eMagiz platform

2. Key concepts

This microlearning focuses on communication between two eMagiz models. When communicating to any external party (from the view of a specific model), you should always consider the following:

  • Security
  • Loose coupling
  • Maintainability
  • Clarity

3. Communication between models

Most users would think that communication via queues to connect two separate eMagiz models is a bright idea. However, this is something that we do not encourage. We discourage this for several practical and technical reasons alike.

When looking at the practical side of things getting it configured correctly is time-consuming and an error-prone action (as is evident by the question). Furthermore, it can lead to unexpected situations where you make a typo to listen to a queue on which no messages are provided. This queue will, however, be registered on the JMS level (when you activate the flow in question with the custom configuration), which can lead to confusing queue statistics and even more troublesome false-positive alerting based on missing queue metrics or missing consumers.

On top of that, when you allow one model to write and read from queues registered in another model, maintaining both models will become very complex. This holds for the ones working on the project at the moment but also for those working on it at a later stage and does that need to provide (incidental) support on the environments.

Another practical reason for not wanting this is that we do not actively support this use case from eMagiz. This means that when we update our technical infrastructure, we will not consider this scenario. This could lead to additional work in the future and reduced stability of your solution.

From the technical point of view, the consequence of this construction is that both models need to know each other certificates and credentials, which are not considered secure. On top of that, because you, theoretically, can exchange data from any queue to any queue, you could create a situation in which updates in one model trigger changes in the other model (i.e., when using the same data model) that are unexpected (and frankly unwanted).

We advise using functionality that makes it explicit that both models function independently of each other. From eMagiz, we consider two valid alternatives for this:
- Using a web service as a communication layer between the two models. This web service can be REST or SOAP and has been implemented before
- Using the Event Streaming functionality of eMagiz to write and read from topics.

Both alternatives have the benefit that the security can be tight and explicit (i.e., only model A can write/post data to model B). Furthermore, managing the solution becomes much easier as it uses the standard functionality within the platform. Therefore, we have no plans to support this approach in the product.

4. Key takeaways

  • Consider the following when communication between two models
    • Security
    • Loose coupling
    • Maintainability
    • Clarity

5. Suggested Additional Readings

If you are interested in this topic and want more information, please consult us at productmanagement@emagiz.com