Mediation vs Integration in Talend ESB


Ever wondered what the difference is between the Mediation and Integration perspectives in Talend Studio?

Both seem to offer different ways to achieve the same thing, so when (and why) would you choose one over the other? This article introduces the features of both perspectives, to help you choose.

Talend Open Studio for ESB, and its commercial counterpart Talend Enterprise ESB, have two main perspectivesIntegration and Mediation.

Understanding perspectives

The term perspective comes from the Eclipse Platform, on which Talend Studio is based. Perspectives are a way of grouping related windows and toolboxes together – that is, things which collectively help you achieve a certain kind of task.

In Talend Studio, developers can choose to build one of two types of components: Integration Jobs, or Mediation Routes. These two types of components use different tools, so they are separated into two perspectives in Studio.

Integration perspective (Jobs)

The Integration perspective includes all of the standard ETL-style components from other editions of Talend, for data processing and transformation, along with the myriad of application connectors (like Amazon AWS, Dynamics, and so on). It also includes some additional ESB-only components, which allow almost any Talend Job to be exposed as a SOAP or a REST service.

Integration perspective in Talend Open Studio for ESB
Integration perspective in Talend Open Studio for ESB

Briefly, Jobs are best for:

  • Heavy lifting and processing of data, especially data that’s stored on disk or in a database
  • Longer-running processes, or those where an immediate response is not required
  • Scenarios which require point-and-click mapping of data from source to target (using the tXMLMap component)

Mediation perspective (Routes)

The Mediation perspective includes a different set of components, which are all based on the Apache Camel integration framework. These components are designed for realtime application integration – providing web services, transforming data, with transactional capability and solid error handling.

Mediation perspective in Talend Open Studio for ESB
Mediation perspective in Talend Open Studio for ESB

Briefly, Routes are best for:

  • Lightweight, stateless routing of messages from one endpoint to another
  • Implementing common Enterprise Integration Patterns (EIPs) like messaging routing and splitting, handling duplicate messages and so on
  • Highly-configurable error handling and transaction management, including automatic retries

In addition, Routes offer better JMS support, more fine grained support for transactions, and far better opportunities for monitoring and testing using the free Hawtio dashboard.

Making the choice

When starting new integrations, you can consider Routes as providing functionality like an ESB – with strong support for many different protocols and easy extensibility – and consider Jobs as providing solid ETL-type functionality.

Consequently when designing integrations centered around web services, JMS and so on, my preference is to favour Routes over Jobs, unless the requirement demands otherwise.

Although there is perhaps a steeper learning curve with Routes, they give you the flexibility to easily expose the same logic over different protocols (JMS, HTTP, and so on). Remember that you can always still implement complex logic using a Talend Job, and invoke it from a Route using cTalendJob.

When do you use Routes and Jobs in your Talend ESB projects? Post your feedback in the comments section below.

Leave a Comment

You can use Markdown in your comment. To write code, indent lines by 4 spaces.