Posts

Showing posts from August, 2015

Talend ESB: query a database directly in the mediation perspective

Image
When exposing a database as a REST or SOAP service, lot of users use: the integration perspective to create a service, but they don’t leverage Camel the mediation perspective to create a route containing a cTalendJob However, there’s an easy alternative. Using the mediation perspective, we can use directly a datasource exposed in the runtime (Karaf) as an OSGi service, and directly use Camel components. The advantages of this approach are: The same DataSource is shared by different routes and services. It means that we can use a PooledDataSource and optimize the connections to the database. We don’t use any Talend job, and directly leverage Camel native components. Route design in the studio We create a route in the mediation perspective of the studio. First, in the Spring tab, we add the DataSource OSGi service lookup. To do so, we add the spring-osgi namespace and use the osgi:reference element: <beans .... xmlns:osgi="http://www.springframework.org/schema/osgi" xs