Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Content-Based Router Revolutionizes the Way to Build Integration Scenarios

DZone's Guide to

Content-Based Router Revolutionizes the Way to Build Integration Scenarios

The Content-Based Router can send alerts based on content, by sorting data. It's easy to set up- learn how in this article.

· Integration Zone
Free Resource

Share, secure, distribute, control, and monetize your APIs with the platform built with performance, time-to-value, and growth in mind. Free 90-day trial of 3Scale by Red Hat

Imagine the following scenario: you are running an online shop and one of the things you’d want to ensure is that you don’t run out of certain well-desired products when least expected. Sure, you can always check the product availability manually, but wouldn’t it be easier if you just get an alert when the stock drops below a certain number?

Meet the Content-Based Router: Send a Message to the Correct Recipient Based on Content

One Business Scenario = One Integration Flow

Now the routing of the original message can be easily set up in the elastic.io Integration Flow Designer with the help of the new Content-Based Router component.

All you need to do is:

  1. Add this component to your integration flow,
  2. Define the conditions according to which you’d like to sort out your data, e.g. $number(shoeSize) <=40,
  3. Add the systems where data will be routed to if meeting or not meeting the conditions,
  4. And… this is basically it.

NOTE: There are several things you’d need to take into account when using this component. For one, this is an Action component, which means that you can select it only after you have already set up a Trigger component, be it a VoIP system, an eCommerce system or even a Webhook.

Another thing is that you will need to make the message evaluation using the JSONata. For more information on how to do this and additional specifications of the Content-Based Router component, please refer to the dedicated article in our Documentation.

This is the first component, where we used JSONata for expressions. Now you can create complex expressions, that include logical expressions, data navigation, and data transformation.

The Benefits

Ok, so, what is so exciting about the Content-Based Router? Besides, of course, the fact that it greatly reduces the complexity of integrations, allowing to replace literally dozens of flows with just one.

Well, for one, the integration flows now actually resemble the business processes they are meant to represent. Now, it’s not just a collection of scattered integration flows, which purpose you can only guess by their names – that is, if these are meaningful enough. No. Now you have a clear overview of what goes where, how and why.

You might also assume that this new Content-based Router component would be easy to use for the so called citizen integrators– the no-coding folk -, and you would be absolutely right. If previously the only way to add the routing conditions was to do some serious coding, now all you need to do is apply some common, Excel-like logic:

Content-based Router_Setup

What to Expect in the Coming Weeks

Very, very soon we will be upgrading the complete Integration Flow Designer to JSONata, a JSON query and transformation language, which will open up absolutely new possibilities for citizen integrators and for developers alike to explore many integrations scenarios that would have otherwise been very cumbersome to set up. The Content-based Router just gives you the first taste of how easy it is going to be.

At the same time, we have started working on upgrading our Security Integration Bridge, which we from now on will call Local Agent. It will become slimmer and faster, and will offer more opportunities when it comes to deploying the elastic.io in multi-cloud.

Stay tuned for more info.

Explore the core elements of owning an API strategy and best practices for effective API programs. Download the API Owner's Manual, brought to you by 3Scale by Red Hat

Topics:
integration ,elastic ,data transformation

Published at DZone with permission of Olga Annenko, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}