Remote Service instances are used in different contexts for reusing certain functions. In such scenarios, it is important to make sure that messages which originate from one flow do not affect other flows. Sender selectors can be extended to resolve such situations. The Fiorano eStudio tool provides an option to auto generate the route selectors for a remote service instance so that components connected to the instance will only get the messages sent to this remote service. It simplifies routing by automatically setting Message Selectors on its output route(s) based on the components that are connected to its input port.
Using Auto set Selectors
To define Selectors on the output port(s) of a component, right-click and select the Autoset Selectors option.
Consider a scenario where there are multiple applications corresponding to various functions such as inventory and sales. All the applications use a single SMTP component for sending out error messages but they need to log the errors in their own dedicated database table. An example is given below.
In an Event Process pertaining to an inventory, the Scheduler fetches the status of inventory from different Vendors by making calls to External Web Services. If there are any errors in their status, these errors are sent to the SMTP service which is a Remote Service Instance. The SMTP service, in turn, is connected to a DB microservice which inserts the error details into this Inventory Errors Database.
The Remote Service Instance listens to error messages from different components of different Event Processes. It is possible that errors that occur in other flows such as Sales will also be inserted into the inventory database. To avoid this, the auto select feature can be used.
Figure 1: Event Process that uses the Remote Service Instance - SMTP component to listen to errors from External Services
To autoset the selectors, right-click the SMTP component and select the Autoset Selectors option.
Figure 2: Selecting Autoset Selectors option on the Remote service Instance
After selecting the Autoset Selectors option on the Remote Service Instance, that is, SMTP component, it listens to only those components which are connected to its input port.
- Filter sign appears next to the filterInventoryErrors route indicating that the filtering is done
- Senders selected will be only those ones connected to its input port
Figure 3: Selectors autoset using Autoset Selectors option