Grouping - Configuration

Last modified by Danniar Firdausy on 2024/09/27 09:11

eMagiz flows, or more specifically, the flow's inbound component(s), can be grouped. The effect is that you can later in Deploy, control them as one entity. This is mainly beneficial when faced with substantial maintenance or outage of systems connected to your eMagiz model.

Building on this functionality, you can even configure the group to run in an active/passive failover mode when you activate the multiple runtimes option on your runtime, and each separate runtime is deployed on another machine. The failover functionality is not only relevant in cases of server maintenance. It can also assist you when you want to exchange data with a system that allows only one active connection. Should this connection be business-critical, you can use this failover functionality to create a passive failover situation that will take over when the active connection breaks down (regardless of the reason). 

In this microlearning, we will focus on configuring the flow to group various inbound components and configure the flow (including the infra) if you want to activate the active/passive failover configuration.

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

1. Prerequisites

  • Intermediate knowledge of the eMagiz platform

2. Key concepts

This microlearning describes how to configure (parts of) your flow(s) to set up the grouping and, if needed, the failover functionality on the flow level. The grouping functionality is relevant when faced with maintenance and outages of systems connected to your model. The failover functionality assists in that case and allows you to have a fallback option on an active connection.

3. Flow Configuration

3.1 Grouping

To configure grouping, we need to open the flow designer of the flow in Create. We want to edit and enter "Start Editing" mode. On the inbound component(s) in the flow, we now have an "Advanced" tab that allows you to configure the grouping information.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-starting-point.png

Note that the options above are available in all inbound components. The one chosen above is simply an illustration of how to configure.

Once on the "Advanced" tab, you must define the group name. You can determine the group name if this is the first flow you change. In all subsequent flows, you want to add to the same group, you must use the same group name.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-define-group-name.png

Once filled in, ensure that the auto startup configuration is set to Yes to ensure that, on default, all flows within the group start up when the container is started.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-define-auto-startup.png

Within a runtime context, you can add multiple groups that can be stopped and started separately from each other. In this example, we would also like to have a group for our exits to stop them if the connecting system undergoes maintenance or is down to store the messages in the queue.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-starting-point-exit.png

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-other-group.png

3.2 Failover

If you want to expand the grouping functionality to include an active/passive failover component, you need to change the settings on the inbound component. Apart from specifying the group name, you need to configure the auto-startup option on "No" so the failover configuration can take the correct actions in all situations.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-failover-example-group.png

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-failover-other-group.png

Note that each group within a single runtime that you want to treat differently needs to have a unique name.

3.3 Failover Infra

The configuration of the infra flow of the runtime for which you want to configure the failover is detailed and only works if you configure all support objects correctly. Although we explain the various steps in the documentation, we advise utilizing the store item we created for this that will guide you in setting this up correctly.

The configuration consists of at least three separate support objects. Two are needed once (infinispan cache manager and clustered lock registry), whereas the other is required per unique group you have defined within the context of your runtime. So, if you have two unique group names within the runtime, you need two leader initiator support objects.

When using this configuration across multiple runtimes on the same machines you need to take the following into account.

  • Each container needs a different port to communicate through. This can be configured by adding a route in Deploy Architecture
  • Each container needs their own cluster. This can be achieved by providing unique names for the cluster when configuring the Infinispan Cache Manager (via the store item)

3.3.1 Infinispan Cache Manager

Given this, let us first look at the Infinispan cache manager. You can add this support object in the standard manner by searching for "infinispan cache manager."

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-cache-manager-search-result.png

Once found, give it a name and fill in a cluster name.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-cache-manager-basic.png

Once done, switch to the "Advanced" tab, select the option "TCP Ping," and fill in the "Host address" and "Other host addresses". Once filled in, press Save to keep your changes.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-cache-manager-advanced.png

Please note the following when configuring the values for the host and other host address(es):

  • The relevant values in case of running on-premise should be requested internally with your infrastructure provider
  • The relevant values in case of running in the cloud can be requested via eMagiz
  • The "Other host addresses" value needs to include a reference to the port through which both hosts communicate.

3.3.2 Clustered Lock Registry

Now that we have the cache manager, we can configure the next support object on our list, the clustered lock registry. You can add this support object in the standard manner by searching for "lock registry."

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-lock-registry-search-result.png

Once found, name it and select the cache manager support object you created.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-lock-registry-basic.png

3.3.3 Leader Initiator

Lastly, we need to configure a leader initiator for each unique group we have defined within the context of the runtime, and that uses the failover functionality. You can add this support object in the standard manner by searching for "leader."

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-leader-initiator-search-result.png

Once found, give it a name, define the role name (which should exactly match the name you gave in the inbound components), and link it to the lock registry.

grouping-and-failover--intermediate-grouping-and-failover-flow-configuration-leader-initiator-basic.png

4. Key takeaways

  • Grouping is beneficial when external systems go through maintenance or downtime.
  • Failover can have the additional benefit of having a fallback scenario while still adhering to the requirement that there can only be one active connection at a time.
  • The role naming in both grouping and failover is crucial. The whole name needs to be matched fully to make it work.
  • For the infra configuration of the failover setup, we have a store item that you can use.

5. Suggested Additional Readings

If you are interested in this topic and want more information, please read the help text provided by eMagiz and check out these links: