talend esb - getting started guidedownload-mirror1.talend.com/esb/user-guide... · talend esb...

114
Talend ESB Getting Started Guide 5.6.2

Upload: others

Post on 20-May-2020

66 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESBGetting Started Guide

5.6.2

Page 2: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB

Publication date: May 12, 2015Copyright © 2011-2015 Talend Inc. All rights reserved.

Copyleft

This documentation is provided under the terms of the Creative Commons Public License (CCPL). For moreinformation about what you can and cannot do with this documentation in accordance with the CCPL, please read:http://creativecommons.org/licenses/by-nc-sa/2.0/

This document may include documentation produced at The Apache Software Foundation which is licensed underThe Apache License 2.0.

Notices

Talend and Talend ESB are trademarks of Talend, Inc.

Apache CXF, CXF, Apache Karaf, Karaf, Apache Cellar, Cellar, Apache Camel, Camel, Apache Maven, Maven,Apache Archiva, Archiva, Apache Syncope, Syncope, Apache ActiveMQ, ActiveMQ, Apache Log4j, Log4j,Apache Felix, Felix, Apache ServiceMix, ServiceMix, Apache Ant, Ant, Apache Derby, Derby, Apache Tomcat,Tomcat, Apache ZooKeeper, ZooKeeper, Apache Jackrabbit, Jackrabbit, Apache Santuario, Santuario, ApacheDS, DS, Apache Avro, Avro, Apache Abdera, Abdera, Apache Chemistry, Chemistry, Apache CouchDB,CouchDB, Apache Kafka, Kafka, Apache Lucene, Lucene, Apache MINA, MINA, Apache Velocity, Velocity,Apache FOP, FOP, Apache HBase, HBase, Apache Hadoop, Hadoop, Apache Shiro, Shiro, Apache Axiom,Axiom, Apache Neethi, Neethi, Apache WSS4J, WSS4J are trademarks of The Apache Foundation. EclipseEquinox is a trademark of the Eclipse Foundation, Inc. SoapUI is a trademark of SmartBear Software. Hyperic isa trademark of VMware, Inc. Nagios is a trademark of Nagios Enterprises, LLC.

All other brands, product names, company names, trademarks and service marks are the properties of theirrespective owners.

This product includes software developed at AOP Alliance (Java/J2EE AOP standards), ASM, AntlR, ApacheActiveMQ, Apache Ant, Apache Avro, Apache Axiom, Apache Axis, Apache Axis 2, Apache Batik, ApacheCXF, Apache Camel, Apache Chemistry, Apache Common Http Client, Apache Common Http Core, ApacheCommons, Apache Commons Bcel, Apache Commons JxPath, Apache Commons Lang, Apache Derby DatabaseEngine and Embedded JDBC Driver, Apache Geronimo, Apache Hadoop, Apache Hive, Apache HttpClient,Apache HttpComponents Client, Apache JAMES, Apache Log4j, Apache Lucene Core, Apache Neethi, ApachePOI, Apache Pig, Apache Qpid-Jms, Apache Tomcat, Apache Velocity, Apache WSS4J, Apache WebServicesCommon Utilities, Apache Xml-RPC, Apache Zookeeper, Box Java SDK (V2), CSV Tools, DataStax Java Driverfor Apache Cassandra, Ehcache, Ezmorph, Ganymed SSH-2 for Java, Google APIs Client Library for Java, GoogleGson, Groovy, Guava: Google Core Libraries for Java, H2 Embedded Database and JDBC Driver, HsqlDB,Ini4j, JClouds, JLine, JSON, JSR 305: Annotations for Software Defect Detection in Java, JUnit, Jackson JavaJSON-processor, Java API for RESTful Services, Jaxb, Jaxen, Jettison, Jetty, Joda-Time, Json Simple, MetaStuff,Mondrian, OpenSAML, Paraccel JDBC Driver, PostgreSQL JDBC Driver, Resty: A simple HTTP REST clientfor Java, Rocoto, SL4J: Simple Logging Facade for Java, SQLite JDBC Driver, Simple API for CSS, SshJ, StAXAPI, StAXON - JSON via StAX, Talend Camel Dependencies (Talend), The Castor Project, The Legion of theBouncy Castle, W3C, Woden, Woodstox : High-performance XML processor, XML Pull Parser (XPP), Xalan-J, Xerces2, XmlBeans, XmlSchema Core, Xmlsec - Apache Santuario, Zip4J, atinject, dropbox-sdk-java: Javalibrary for the Dropbox Core API, google-guice. Licensed under their respective license.

Page 3: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB Getting Started Guide

Table of ContentsChapter 1. Introduction to Talend ESB solutions ............................................................ 1

1.1. Talend ESB Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.1.1. Web Services Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.1.2. Standard OSGi Runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.3. Messaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.1.4. Talend Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.2. Talend ESB products and architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.1. Talend ESB Standard Edition (SE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.2. Talend Open Studio for ESB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.3. Talend Enterprise ESB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.2.4. Talend Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Chapter 2. Getting started with Talend ESB ................................................................. 132.1. Prerequisites to using Talend ESB products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2. Downloading and installing the software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.1. For the Community products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2.2. For the Enterprise and Platform products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3. Creating an alternate container for the Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.4. Starting the software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.4.1. Starting Talend Runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.4.2. Starting the Talend Administration Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4.3. Starting the Talend Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.4.4. Starting the ESB dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.5. Software prerequisites for the Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Chapter 3. Basic deployment and runtime use cases ....................................................... 27

3.1. Building and deploying Data Services and Routes using the Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.1.1. Building a simple SayHello data service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.1.2. Accessing the events in the ESB Dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403.1.3. SayHelloRoute example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

3.2. Building and deploying REST Services using the Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.2.1. Building a simple REST service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483.2.2. Deploying the REST service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603.2.3. Building a simple REST Service consumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703.2.4. Accessing the events in the ESB Dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

3.3. Building and deploying Data Services and Routes using Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763.3.1. The Rent-a-Car demo example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763.3.2. Deploying the demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793.3.3. Running the demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813.3.4. Uninstalling the demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

3.4. Importing the Rent-a-Car Java demo into Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.4.1. Building the project files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.4.2. Importing into Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.4.3. Running the examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

Chapter 4. Advanced deployment and runtime use cases with SOA Governance ................ 874.1. Rent-a-Car demo using Service Locator and Service Activity Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

4.1.1. Installing and starting the Service Locator and Service Activity Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . 884.1.2. Uninstalling previous features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904.1.3. Building the demo with Service Activity Monitoring and Service Locator enabled . . . . . . . . . . . . . . . . . . . 904.1.4. Installing the Rent-a-Car examples features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914.1.5. Running the demo in one container to generate Service Activity Monitoring data . . . . . . . . . . . . . . . . . . . . . 924.1.6. Running the demo in two containers - simulating server failover with Service Locator . . . . . . . . . . . . . . . 944.1.7. Accessing the events in the ESB Dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 964.1.8. Uninstalling the demo features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

4.2. Rent-a-Car demo using the Security Token Service to provide WS-Security based SAMLAuthentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

4.2.1. Configuring logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 984.2.2. Building the demo with Security enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994.2.3. Uninstalling the demo features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

4.3. Rent-a-Car demo using the Artifact Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1004.3.1. Downloading and installing Nexus Artifact Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014.3.2. Publishing the demo to the Artifact Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014.3.3. Deploying the demo to Talend ESB Standard Edition with Nexus Artifact Repository . . . . . . . . . . . . . . 1034.3.4. Deploying the demo from Artifact Repository to Talend Runtime with Talend AdministrationCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

4.4. Rent-a-Car demo using XKMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064.4.1. Configuring the XKMS service for the demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064.4.2. Building the Rent-a-Car demo example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

4.5. Accessing all ESB event logs in Talend Administration Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

Page 4: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB Getting Started Guide

Page 5: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB Getting Started Guide

Chapter 1. Introduction to Talend ESBsolutionsThe Enterprise Service Bus (ESB) has always been the cornerstone of every vendor's Service Oriented Architecture(SOA) strategy. Talend ESB is a considerable improvement on previous ESBs in that it:

• has relatively small footprint

• uses proven open source technologies

• enables easy integration of existing applications and infrastructures

This chapter gives a high level overview of Talend ESB solutions, their components and features, including theTalend Runtime, an OSGi container, the support for Web Services, and the Talend Studio.

It also describes the packages that are available, and details of the architecture of each of them.

Page 6: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB Features

2 Talend ESB Getting Started Guide

1.1. Talend ESB FeaturesTalend ESB is a versatile and flexible ESB that allows organizations to address diverse integration challenges.It supports a broad set of standard transports and protocols, as well as enterprise integration patterns (EIPs),a common set of best practice descriptions developed to design effective messaging solutions. Available inseveral packages, Talend ESB is open and standards-based to allow wide interoperability with existing and legacyinfrastructure components.

Talend invests, promotes and nurtures the underlying technology of Talend ESB through its participation inthe Apache Software Foundation (ASF), a leading open source community recognized for its transparency andfor delivering enterprise-grade, freely available software products that are designed and built from a diversecommunity of users. Increasingly, the open source communities—rather than the vendors of proprietary software—are driving the next generation of innovations.

Leveraging Apache CXF, Apache Camel and Apache ActiveMQ open source integration projects, Talend ESBmakes enterprise-class integration accessible by delivering a cost-effective and easy-to-use way to integrate andexpand systems and applications.

An open source services framework, Apache CXF helps companies build and develop services using front-endprogramming APIs like JAX-WS and JAX-RS.

Apache Camel is a powerful open source integration framework that lets you leverage EIPs to implement routing,transformation and mediation rules.

Powered by Apache ActiveMQ, the most popular open source messaging provider, each message broker canhandle myriad connections while processing thousands of persistent messages per second.

1.1.1. Web Services Support

Talend ESB helps you to create new Web services or to service-enable your existing applications and interfacesfor use with the Web. Developers use a declarative, policy-centric approach to enable different qualities of servicethrough configuration, rather than code. Talend ESB leverages the features of Apache CXF for developing anddeploying Web Services and REST applications.

Apache CXF provides a lightweight, modular architecture that is supported by the popular Spring Framework. Soit works with your application, regardless of the platform on which it is running. It can be run as:

• a stand-alone Java application

• as part of a servlet engine (such as Tomcat)

• as an OSGi bundle on an OSGi container (such as Talend Runtime)

Apache CXF supports all important Web services standards and fully complies to the Java API for XML WebServices (JAX-WS) specification. JAX-WS defines annotations that allow you to tell a tool like CXF howyour standalone Java application should be represented in a Web services context. Two types of Web servicesdevelopment with CXF are possible:

1. Contract-first development:

WSDLs define what operations and types a Web service provides. This is often referred to as a Web servicescontract, and in order to communicate with a Web service, you must satisfy the contract. Contract-firstdevelopment means that you start out by writing a WSDL file (either by hand or with the help of tooling), andthen generating stub Java class implementations from the WSDL file by using a tool like CXF.

Page 7: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Standard OSGi Runtime

Talend ESB Getting Started Guide 3

2. Code-first development:

The other way to develop Web services is by starting out with a Java class and then letting the Web serviceframework handle the job of generating a WSDL contract for you. This is the easiest mode of development,but it also means that the tool (CXF in this case) is in control of what the contract will be. When you want tofine-tune your WSDL file, it may be better to go for contract-first approach.

Apache has been certified and tested to work with the broadest set of vendors’ Web services implementations.Users benefit from this interoperability testing, which reduces the overall cost and complexity for applicationintegration.

Talend ESB supports the creation of SOAP and REST Web services and offers the best WS-* functionality inthe market, including support for WS- Addressing, WS-Reliable Messaging, and WS-Security over both HTTPand JMS transports.

In addition, the Web services stack in Talend ESB distributions goes well beyond Apache CXF, with support for:

• OSGi containers along with illustrative examples and documentation

• Graphical Data Service Development using the Talend Studio

• Advanced Service Governance using Deployment Time Policies

• Central deployment and configuration options via Web User Interfaces and JMX based APIs

• Management and monitoring of services

1.1.2. Standard OSGi Runtime

The standard runtime in Talend ESB is an OSGi container. The OSGi implementation shipped with Talend ESBis Apache Karaf using Eclipse Equinox as OSGi Runtime, providing a lightweight container into which variouscomponents and applications can be deployed.

Figure 1.1. Overview of Karaf components

Karaf supports the following features:

• Hot deployment: Karaf monitors any file inside the [home]/deploy directory (for example: XML files to createa database connection pool, Jar and Kar files for drivers, and so on). So if a file is copied into this directory,it is automatically installed inside the runtime; subsequently this can be updated or deleted, and Karaf will actcorrespondingly.

• Dynamic configuration: Services are usually configured through a standard OSGi service, using property files,which are monitored; changes are propagated to the service.

Page 8: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Messaging

4 Talend ESB Getting Started Guide

• Logging: using a centralized logging back end supported by Log4J.

• Managing instances: Karaf provides simple console commands for managing multiple instances.

• See Building and deploying Data Services and Routes using Java for an example of using Karaf. For furtherinformation, please see the Talend ESB Container Administration Guide and http://karaf.apache.org/.

1.1.3. Messaging

Enterprise messaging software has been used for integration projects more than 30 years now. Not only ismessaging a style of communication between applications, it is also a widely adopted style of integration betweenapplications. Messaging fulfills the need for both notification and asynchronous, loosely coupled interoperationbetween applications.

Talend ESB embeds Apache ActiveMQ message broker to support a number of different messaging options.ActiveMQ is written in Java and implements the JMS specification. In addition to that, many other featuresare added on top to provide high availability, performance, scalability, reliability, and security for enterprisemessaging.

The job of the message broker is to transport events between distributed applications, guaranteeing that they reachtheir intended recipients. The broker therefore must be highly available, performant, and scalable for this goal,which Apache ActiveMQ provides an easy to use way in Talend ESB, as it is embedded in Talend Runtime.

1.1.4. Talend Studio

The Talend Studio provides a graphical development tool with:

• an Integration perspective

• a Mediation perspective

• a Java perspective (Enterprise and Platform studios including m2eclipse Plugin)

• a soapUI perspective (Enterprise and Platform studios only)

These are discussed in more detail in the rest of this section.

1.1.4.1. Integration perspective

The Integration perspective is a graphical tool within the Talend Studio which allows you to use the extensivelist of data adapters and components to build ESB data services and export them for standalone or for deploymentin a local Talend Runtime container. The Enterprise and Platform studio also enables to publish services ina provisioning repository in the artifact repository for remote deployment from Talend Administration Center.The Integration perspective provides data services development through an easy-to-use graphical developmentenvironment. It enables rapid deployment and reduces maintenance costs with prebuilt connectors to all sourceand target systems, with support for all types of data services, data migration and data synchronization operations.

The core of the Integration perspective comprises four major applications (Business Modeler, Job Designer,Service Designer, and Metadata Manager) within a single graphical development environment based on Eclipse.

Page 9: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend Studio

Talend ESB Getting Started Guide 5

Figure 1.2. The Integration perspective with a Service design

A Service in the 'Services' node is a Web-Service defined by a WSDL. The WSDL can be just imported, createdfrom scratch in the tooling using the embedded graphical WSDL editor or an existing WSDL can be importedand then edited within the studio. In this case the Service is based on this WSDL information and each serviceoperation can then be implemented in the Job Design node.

Figure 1.3. The Integration perspective with a Job design

A data service Job is a graphical design, of one or more components connected together, that allows you to setup and run data service operations. Jobs address all of the different sources and targets that you need for dataintegration processes and combine it with Web services.

Additionally, in Enterprise and Platform studios, you can use the shared repository feature to work in larger teams,and share resources. It has the facility of team collaboration - team members can store and share their business

Page 10: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend Studio

6 Talend ESB Getting Started Guide

models, integration and service jobs, integration services and metadata in an industry-standard source manager(SVN). This promotes reusability of objects and code, as well as facilitating the design of development bestpractices. There are also more extended productivity features like Wizards (for example, for SAP) and deploymentoptions (Publish to artifact repository) available in those Talend Studios.

More information on this can be found in the Talend Studio User Guide.

1.1.4.2. Mediation perspective

This section first deals with Apache Camel, and then the Mediation perspective which is a graphical interfaceto this functionality.

Apache Camel

The Mediation functionality of Talend ESB is based on the popular Apache Camel project. The core of the Camelframework is a routing engine. It allows you to define routing rules, that accept and send messages throughComponents. There are no restrictions on the message format - for example, Java objects, XML, JSON, plain textand so on, can be used. These routing rules are based on the book “Enterprise Integration Patterns” from GregorHohpe; Bobby Woolf; et al.

Thus, Apache Camel is a framework allowing developers to assemble Endpoints / Processors into workflows(Routes) to achieve higher level functionality. It facilitates application integration by leveraging EnterpriseIntegration Patterns (EIPs) to essentially assemble scalable services, and make message-based system integrationsimpler to design and implement. Camel is an open source Java framework that lets you use EIPs to implementrouting and mediation rules using a Java-based Domain Specific Language (DSL). This means you get completionof routing rules that can easily and rapidly be updated if requirements change.

EIP and hence Camel are focused on asynchronous messaging patterns because asynchronous patterns arenecessary for scalability. But asynchronous messaging is more complex. Camel wraps that complexity in acommon framework which is widely understood by integration developers.

Because of the high-level abstractions in Camel (for example, Message, Exchange, Component, Endpoint), youcan use the same APIs to interact with various systems. For example, every route implements Component andEndpoint APIs and works with the same basic Message and Exchange structure. Each component is implementedto work with specific protocols and data types. So you can wire together very different protocols and system veryeasily while using the same patterns and routing semantics.

Camel mediates both formats and transports between different endpoints. Typically, this allows Services tocommunicate with each other, via Camel mediation, even if using different message formats, and written usingdifferent languages. It also makes adding functionality like logging and tracking easy. Camel is also verylightweight and can be embedded or deployed anywhere you like, such as in a standalone Java application, Webapplication, or an OSGi bundle.

You can use the Java Domain Specific Language (DSL) to specify a route. For example:

From(“file:directory”).to(“jms:queuename”)

This simple statement polls files from a directory and sends the content of each file as a JMS message to a JMSqueue. This can be done because Camel provides a uniform interface based on the Exchange object. For thatmatter, Camel is a really useful and powerful tool as it includes data formats and type converters for automaticand easy message transformation. It can also be used to extract, transform and load the content of those files.

Mediation perspective

On top of Apache Camel, and integrated with the Talend Studio, the Route Builder (Mediation perspective) is aGUI that allows a developer to build these Routes in a visual way.

You can run the Routes in a standalone mode or export them as OSGi Bundles which can be easily deployedwithin the Talend Runtime container. Additionally in the Enterprise and Platform studios, you can use the sharedrepository feature to work in larger teams.

Page 11: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB products and architecture

Talend ESB Getting Started Guide 7

Figure 1.4. The Mediation perspective

Out of the box, Talend ESB supports over 80 protocols and data types, through its extensive library of components.These components enable a Route to connect over transports, use APIs, and understand data formats. You canalso create your own components very easily; the component API is very concise. Talend ESB has a modulararchitecture, which allows any component to be loaded into Camel, regardless of whether the component shipswith Camel, is from a third party, or is your own custom creation. The creation of your own components (forexample, for processing, connectivity, routing, and so on) is simple and well documented.

1.2. Talend ESB products and architectureBeyond the standard functionality included in the Apache projects, Talend provides ESB functionality in fourdifferent packages to suit your current and future requirements, described in the following sections. For a quickcomparison of these ESB products, view the online ESB Comparison Matrix.

1.2.1. Talend ESB Standard Edition (SE)

Talend ESB Standard Edition is a standards-based connectivity layer used to integrate distributed systems acrossfunctional, enterprise, and geographic boundaries. Capabilities include messaging, Web services, intelligentrouting, and data transformation. Its modular, pluggable architecture allows it to be easily expanded to suit mostenterprise requirements, and it is available under the open source Apache license. It also includes the followingenterprise-class capabilities:

• Service Locator—Talend ESB Standard Edition provides automatic and transparent failover and load balancingthrough a newly developed extension to Apache CXF that allows for dynamic endpoint registration and lookupthrough Apache Zookeeper.

For more information, see Rent-a-Car demo using Service Locator and Service Activity Monitoring and theTalend ESB Infrastructure Services Configuration Guide.

Page 12: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend Open Studio for ESB

8 Talend ESB Getting Started Guide

• Service Activity Monitoring—By capturing events and storing activity information, Talend ESB StandardEdition facilitates more in-depth analysis of service activity, including service response times, traffic patterns,service lifecycle and auditing.

For more information, see Rent-a-Car demo using Service Locator and Service Activity Monitoring and theTalend ESB Infrastructure Services Configuration Guide.

• Security Token Service (STS) Framework—Talend ESB Standard Edition includes an STS Framework thatsupports Security Assertion Markup Language (SAML 2.0) to federate security credentials across applicationsand domains. This allows clients and services to securely and transparently authenticate during connectionswithout the need for custom coding. This STS Framework is another significant contribution that Talend hasmade to the Apache CXF community.

For more information, see Rent-a-Car demo using the Security Token Service to provide WS-Security basedSAML Authentication and the Talend ESB Infrastructure Services Configuration Guide.

1.2.2. Talend Open Studio for ESB

Talend Open Studio for ESB – an innovative, Eclipse-based tooling environment for modeling, configuring,deploying and managing data services – includes Talend ESB Standard Edition. Talend Open Studio for ESBeliminates lengthy learning curves and speeds time to deployment by making developers more productive—enabling organizations to rapidly respond to business demands.

Page 13: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend Open Studio for ESB

Talend ESB Getting Started Guide 9

Figure 1.5. Talend Open Studio for ESB operating principles

Three different types of functional block can be identified:

• The blue block represents a Talend Studio API where you can carry out data integration or data service processes,mediation routes and services. For more information, see their corresponding chapters in the Talend Open Studiofor ESB User Guide.

• The other blocks represent Talend ESB Standard Edition which is composed of one or more Talend Runtimesand the additional ESB infrastructure services:

• In red, one or more Talend Runtimes (execution container) deployed inside your information system. TalendRuntime enables you to deploy and execute the Jobs, Routes, and Services created in the Talend Studio. Formore information on how to deploy items in Talend Runtime, see the Talend Open Studio for ESB User Guide,and for more information about Talend Runtime itself, see the Talend ESB Container Administration Guide.

If you have several Talend Runtimes on which to deploy the Services and Routes, you will be able to loadbalance their execution according to your needs. All instances of Talend Runtime will communicate betweeneach other via the Service Locator to identify the one more likely to deploy and execute them.

• In orange, a monitoring database gathering log information of the execution of your data processes and serviceactivity.

Data processes log information can be captured in the Talend Studio with the use of tFlowMeterCatcher,tStatCatcher, tLogCatcher components. For more information, see the Talend Components ReferenceGuide. And to automate the functionalities of the tFlowMeterCatcher, tStatCatcher, tLogCatcher

Page 14: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend Enterprise ESB

10 Talend ESB Getting Started Guide

components without using them, you can use the Stats & Logs tab. For more information regarding Stats &Logs, see the Talend Open Studio for ESB User Guide.

The Service Activity Monitoring allows the end-users to monitor service calls. It provides monitoring andconsolidated event information that they can use to understand the underlying requests and replies thatcompose the event, monitor faults that may be unexpectly generated and support the system managementdecisions. For more information on the Service Activity Monitoring, see its corresponding chapter in theTalend ESB Infrastructure Services Configuration Guide.

• In addition to Service Locator and Service Activity Monitoring, Talend Runtime provides Security TokenService functionalities which can be used to establish a trust relationship between a client and a Web service,particularly if they are in different security domains. The Security Token Service is used to issue a securitytoken, that is, a collection of claims such as name, role, and authorization code, for the client to access theservice. The message receiver only must know the STS certificate for verifying the token signature to get atrusted statement of the authentication information.

For more information on the installation of all these applications, see the Talend Installation and Upgrade Guide.

1.2.3. Talend Enterprise ESB

Talend Enterprise ESB is designed for application teams that need to manage development projects across teamsand operate their integrated production environments across their enterprise in a coherent manner. As such, TalendESB includes all of the functionality of Talend Open Studio for ESB and extends it with team collaboration,enterprise management and other capabilities.

Figure 1.6. Talend Enterprise ESB operating principles

Five different types of functional block are defined:

• The light blue block includes one or more Talend Studio APIs and Web browsers that could be on the sameor on different machines.

Page 15: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend Enterprise ESB

Talend ESB Getting Started Guide 11

From the Studio API, end-users can carry out technical processes: data integration or data service processes,mediation routes and services, and publish them on the Artifact Repository. The Talend Studio allows the userto work on any project for which he has authorization. For more information, see the Talend Studio User Guide.

From the Web browser, end-users connect to the remotely based Talend Administration Center through asecured HTTP protocol.

The end-user category in this description may include developers, project managers, administrators and anyother person involved in building Web, REST and data services, and mediation routes. Each of these end-userswill use either the Talend Studio or Talend Administration Center or both of them depending on the companypolicy.

• The violet block includes a web-based Talend Administration Center (application server) connected to twoshared repositories: one based on an SVN server and one based on a database server.

The Talend Administration Center enables the management and administration of all projects. Administrationmetadata (user accounts, access rights and project authorization for example) is stored in the database serverand project metadata (Jobs, Business Models, Routines, Routes, Services for example) is stored in the SVNserver (to easily share them between the different end-users).

Talend Administration Center also enables you to access and manage the Routes or Services created from theTalend Studio and published into the artifact repository, and set up and monitor their deployment and executionin the Talend Runtime.

Furthermore, Talend Administration Center enables you to access and use your ESB artifacts more securely,and to manage the users who will only access resources to which they are authorized. In fact, with TalendAdministration Center, you can store and manage your service resources and their policy-based security in adedicated repository, the Service Registry. The Service Registry itself is part of the Talend ESB Container,however, from Talend Administration Center, you can centralize, maintain and distribute services and policies.This way, your company’s services and policies will stay accessible, consistent and reusable at all time. Inaddition to service security, Talend Administration Center provides authorization capabilities that enables youto give specific users, and roles, access rights to specific services. The users and their role should primarilybe defined in the Talend Identity Management Service Web application (based on Apache Syncope), alsoaccessible via Talend Administration Center.

Finally, from Talend Administration Center, you can monitor and search through events collected acrossdistributed containers. Those Events can be logs from the Talend Runtime container (Jobs, Routes, etc.), OSGievents generated by Talend Runtime (information about bundles) and Service Activity Monitoring events. Formore information about the different events that can be monitored, indexed and searched and how to configuretheir collection, see the Talend ESB Infrastructure Services Configuration Guide.

For more information, see the Talend Administration Center User Guide

• The dark blue block represents the artifact repository that stores all the:

• Software Updates available for download.

• Routes and Services that are published from the Talend Studio and are ready to be deployed and executedin Talend Runtime.

You can access those artifacts via the Artifact repository Web application accessible from the ESB Publisherand the Software update pages of the Talend Administration Center.

• The red block represents one or more Talend Runtimes (execution container) deployed inside your informationsystem. The Talend Runtime deploys and executes the technical processes according to the set up defined inthe Talend Administration Center Web application. Those processes are Routes and Services retrieved fromthe artifact repository.

If you have several Talend Runtimes on which to deploy the Service and Route artifacts, you will be able to loadbalance their execution according to your needs. All instances of Talend Runtime will communicate between

Page 16: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend Platforms

12 Talend ESB Getting Started Guide

each other via the Service Locator to identify the one more likely to deploy and execute the artifact(s) set todeployment in Talend Administration Center. The Talend Runtime elected for the deployment will request forthe artifact(s) to deploy and execute from the Artifact Repository and the Artifact Repository will thus sendthe artifact(s) requested along with all the dependencies needed for its/their execution to the Talend Runtime,Talend Runtime that will deploy and execute them.

• The orange block represents the Monitoring with the Activity Monitoring Console and the Service ActivityMonitoring.

The Activity Monitoring Console allows end-users to monitor the execution of technical processes. It providesdetailed monitoring capabilities that can be used to consolidate collected log information, understand theunderlying data flows interaction, prevent faults that could be unexpectedly generated and support the systemmanagement decisions.

The Service Activity Monitoring allows the end-users to monitor service calls. It provides monitoring andconsolidated event information that the end-user can use to understand the underlying requests and repliesthat compose the event, monitor faults that may be unexpectly generated and support the system managementdecisions.

For more information on the installation of all these applications, see the Talend Installation and Upgrade Guide.

1.2.4. Talend Platforms

Talend Platforms (for Data Services, for Enterprise Integration, for MDM, and Universal) extends TalendEnterprise ESB with advanced clustering, business process management, application integration, extended datamapping and data management features allowing firms to increase business productivity, deliver projects faster,and lower operating costs. Talend Platform Universal includes Big Data technologies by default, but it is alsoavailable as an option in the other platforms. And Talend Platform for Enterprise Integration and Universal alsoinclude BPM for advanced modeling, development, deployment and management functionalities.

Page 17: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB Getting Started Guide

Chapter 2. Getting started with Talend ESBThis chapter gives you the information needed to start using the Talend ESB software. By the end of this chapter,you should be ready to run the demo examples of the following chapters.

The major steps to follow to get started with the software are described in the following sections:

1. Prerequisites to using Talend ESB products

2. Downloading and installing the software

3. Starting the software

4. Software prerequisites for the Demos

Page 18: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Prerequisites to using Talend ESB products

14 Talend ESB Getting Started Guide

2.1. Prerequisites to using Talend ESBproductsThere is a number of software and hardware prerequisites you should be aware of, prior to starting the installationof Talend ESB products.

For a complete list of installation requirements, compatible software and software versions:

• If you are using the Talend Studio, see the Talend Installation and Upgrade Guide.

• If you are using Talend ESB Standard Edition, see the corresponding Talend Installation Guide.

<TalendRuntimePath> is used for the directory where Talend Runtime is installed. This is typically the full path of eitherRuntime_ESBSE or Talend-ESB-VA.B.C, depending on the version of the software that is being used. Please substituteappropriately.

For instance, the Talend Runtime examples are in the <TalendRuntimePath>/examples/talend directory.

2.2. Downloading and installing the softwareThis section shows what products could and will be used for the demos documented in the following chapters andhow to install, configure and start them.

Depending on the version of the product you are using, see the sections:

• For the Community products.

• For the Enterprise and Platform products.

2.2.1. For the Community productsTalend ESB community products are freely available on the Website: http://www.talend.com/download.

The products available are:

• Talend ESB Standard Edition, an OSGi container based on Apache Karaf with additional Infrastructure Services.

• Talend Open Studio for ESB, that includes both a Studio and an ESB Runtime. The ESB Runtime is the exactequivalent of the Talend ESB Standard Edition product.

For an overview of these products, see Introduction to Talend ESB solutions in this guide.

Software needed for the demos:

• For the use cases documented in Building and deploying Data Services and Routes using the Studio and Buildingand deploying REST Services using the Studio, you will need to install and start both the Studio and ESBRuntime of the Talend Open Studio for ESB, with Infrastructure Services enabled.

• Whereas for the use cases documented in Building and deploying Data Services and Routes using Java, Rent-a-Car demo using Service Locator and Service Activity Monitoring, Rent-a-Car demo using the Security TokenService to provide WS-Security based SAML Authentication, you will only need the Talend ESB StandardEdition (or the ESB Runtime of Talend Open Studio for ESB), with Infrastructure Services enabled.

• The use case documented in Rent-a-Car demo using the Artifact Repository is more addressed to users of theEnterprise and Platform products, as it requires a repository management software, included by default in thoseproducts. However, the use of an external repository management software is also possible with the communityproducts.

Page 19: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

For the Enterprise and Platform products

Talend ESB Getting Started Guide 15

• The use case documented in Rent-a-Car demo using XKMS is addressed to users of the Enterprise and Platformproducts only, as it requires the encryption functionalities available in those products.

For more information about:

• Installation and starting of the Talend Open Studio for ESB and Infrastructure Services, please follow theinstructions of the Talend Open Studio for ESB Installation and Upgrade Guide.

• Installation and starting of the Talend ESB Standard Edition and Infrastructure Services, please follow theinstructions of the Talend ESB Standard Edition Installation Guide.

2.2.2. For the Enterprise and Platform productsCustomers who subscribed to the Enterprise or Platform editions are sent an email with download instructionsand a license file.

To install the Enterprise or Platform editions, it is recommended to use the Talend Installer. Alternatively, pleasefollow the instructions available in the Talend Installation and Upgrade Guide provided to you in the email.

For an overview of these products, see Introduction to Talend ESB solutions in this guide.

2.3. Creating an alternate container for theDemosOne Talend Runtime container is included in the container subdirectory of the Talend ESB installation. However,to run some of the demo use cases described in this guide, it is necessary to have two containers, and this sectiondescribes how to create the second one on the same machine.

The second container matches a common real world situation of client and server running on different containers.It is a copy of the Talend Runtime container that you can launch separately and deploy applications into. Thissecond container is needed in the SayHelloRoute part of the SayHello example - see SayHelloRoute example, andin the Service Locator part of the Rent-a-Car example - see Rent-a-Car demo using Service Locator and ServiceActivity Monitoring.

For users of Talend ESB Standard Edition or Talend Open Studio for ESB, respectively take directly the TESB_SE-VA.B.C package you downloaded or the Runtime_ESBSE folder extracted from the installation of the Talend OpenStudio for ESB, and copy its container folder.

For Enterprise and Platform customers, take the Talend-ESB-VA.B.C package you downloaded, and copy itscontainer folder. You can also directly use the Talend Runtime package (Talend-Runtime-VA.B.C), which isthe exact equivalent of the container folder of the Talend ESB.

For the Enterprise and Platform customers who installed Talend ESB via the Talend Installer, you will have tocopy the esb/container folder.

Copy the container

1. Make sure that the container you will copy has never been started before.

2. In a Linux terminal or Windows command line window, change directory to <TalendRuntimePath>.

3. Create a copy of directory container with all its content by executing the relevant command:

• cp -r container alternate-container (Linux)

• robocopy /e container alternate-container (Windows)

Page 20: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the software

16 Talend ESB Getting Started Guide

• xcopy /e container alternate-container (older Windows with no robocopy)

Now, you have a second container in directory alternate-container.

In order to avoid conflicts between the two container instances, the configuration of the alternate-containerneeds to be adjusted.

Configure the alternate container

1. Make sure the default (first) container is not running at the same time, or there will be a port conflict.

2. Start the alternate-container with default settings:

• Under Linux, go to directory <TalendRuntimePath>/alternate-container and execute the followingcommand:

./bin/trun

• Under Windows, go to directory <TalendRuntimePath>\alternate-container and execute thefollowing command:

.\bin\trun.bat

3. Wait until the initialisation phase has finished. To make sure the Talend Runtime is started with all its bundlescreated and active, run the following command:

list

4. Execute the following command at the alternate container prompt to call Talend Runtime configurationadaptation script that will set another unique group of settings:

source scripts/configureC1.sh

The settings are now updated and saved locally. The next time you run the alternate container, the new settingswill be used, and both container and alternate-container can be running at the same time.

5. It is not required for the following demos, but if you would like to create a third or fourth container, copy theoriginal container directory to a third location (see above). Again, start running the third container and usethe following command at the container prompt to call another adaptation script:

source scripts/configureC2.sh

Similarly, a fourth container should use:

source scripts/configureC3.sh

You can reconfigure the default values in any container using:

source scripts/configureC0.sh

If you get the "Port already in use" exception when starting an alternate container, recheck that there is not already a containerrunning using the default parameters. If you still get the error, it may also be that the port is in use by an unrelated process,so update the configuration files in the alternate-container/etc folder by hand accordingly.

2.4. Starting the softwareThis section will help you start the software needed to follow the use cases described later on in this guide.

First, make sure you installed properly the product by following the instructions described in the TalendInstallation and Upgrade Guide.

Page 21: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting Talend Runtime

Talend ESB Getting Started Guide 17

Depending to the software you need to use, follow the instructions described in:

1. Starting Talend Runtime.

2. Starting the Talend Administration Center (Enterprise or Platform only).

3. Starting the Talend Studio.

4. Starting the ESB dashboards.

2.4.1. Starting Talend Runtime

This section will show you how to quick-start the Talend Runtime of both Talend ESB Standard Edition and TalendESB Enterprise and Platform Edition. In the section, both of these are referred to as 'Talend Runtime', unless thereis a specific difference. The section additionally describes how to start the Talend Runtime infrastructure services.

It is recommended to read Prerequisites to using Talend ESB products before starting this section, and thendownload the Talend Runtime as described in Downloading and installing the software.

This package includes:

• Talend Runtime container

and the infrastructure services:

• Service Locator

• Service Activity Monitoring

• Security Token Service

and also:

• the message broker Apache ActiveMQ

2.4.1.1. Starting the Talend Runtime container

1. If you installed the product via the Talend Installer, you first have to stop the "Talend Runtime" service.

2. Go to subdirectory <TalendRuntimePath>\container\bin of the Talend Runtime installation directory.

3. Run the trun.bat (Windows) or trun.sh (Linux) file.

When the container starts up, you will see a short introduction (similar to the one below) followed by theTalend Runtime container console command prompt:

After starting the Talend Runtime container, you need to wait a few seconds for initialization to complete beforeentering the commands. Karaf, on which the Talend Runtime container is built, starts the non core bundles in thebackground. So even if the console is already available, the commands may not.

4. At the Console prompt: karaf@trun>, type in the list command.

This will list all the OSGi Bundles installed in the Talend Runtime container and let you know if they areactive yet, or not.

Page 22: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the Talend Administration Center

18 Talend ESB Getting Started Guide

For further information, see the Talend Installation and Upgrade Guide.

You can find further information about the Talend Runtime container and how to get started with it in the TalendESB Container Administration Guide.

2.4.1.2. Starting all Infrastructure Services

Instead of starting each Infrastructure Service individually, you can start them all at once. So, once the TalendRuntime container started and all the bundles active:

1. Simply type in tesb:start-all to start all the Infrastructure Services.

Now, the Service Locator, Service Activity Monitoring and Security Token Service services are running asfeatures in the Talend Runtime container.

For the Enterprise and Platform Talend ESB, this command works the same as for the Talend ESB StandardEdition and the Talend Open Studio for ESB, but it installs and starts additional services (for example: ServiceRegistry, Authorization, and so on).

2. For demo purpose, Enterprise and Platform users need to change the default security management system,the Talend Identity Management Service, to the Talend ESB Standard Edition and Talend Open Studio forESB default one, the JAAS authentication handler, which is easier to use, and does not require the installationof additional software.

From the Talend Runtime container console prompt, type in:

tesb:switch-sts-jaas

For more information on how to launch each of the above services individually or as standalone, see the TalendInstallation and Upgrade Guide.

And for more information on Talend ESB Infrastructure Services, see the Talend ESB Infrastructure ServicesConfiguration Guide.

2.4.2. Starting the Talend Administration Center

If you are an Enterprise or Platform user, you would need to start the Talend Administration Center at this point.If you are a user of the Talend Open Studio for ESB, please go directly to the Starting the Talend Studio.

From the Talend Administration Center, you will be able to create a new remote project, create a new user accountfor yourself and give access right for yourself to this newly created project. The advantage of such remote projectsis that several users can work collaboratively on the same centralized project, which is the least for company-scale projects.

You will also be able to manage the publishing and deployment of ESB artifacts like SOAP services, REST serviceJobs, and Routes developed via the Talend Studio into the Talend Runtime container directly from the TalendAdministration Center. To do so, you have to connect the Talend Administration Center to the Talend Runtimecontainer. For more information, see Connecting the Talend Runtime to the Talend Administration Center.

2.4.2.1. Running the Talend Administration Center

1. If you installed the product via the Talend Installer, go to the directory named tac.

Page 23: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the Talend Administration Center

Talend ESB Getting Started Guide 19

2. Double-click the executable file: start_tac.bat.

This will launch the servlet container (by default, Apache Tomcat) holding the Talend Administration Center.

3. Once started, log in to Talend Administration Center with the default account: [email protected]/admin.

If you manually installed the product, it means that you deployed the Talend Administration Center in your ownservlet container, so simply run that container to start the Talend Administration Center.

2.4.2.2. Configuring the Talend Administration Center

Click the Configuration link in the left-hand menu to finish configuring the Talend Administration Center.

Most of the warnings displaying are due to the fact that you did not start all the modules of the product yet. Forexample:

• Commandline/secondary will get green only if you decide to use and start a secondary commandline, whichwill not be the case in the following demo use cases.

• ESB Service Locator and SAM should be green if you started the Talend ESB and its Infrastructure Services.

• ESB Identity and Access Management will get green only if you install and start the Talend IdentityManagement Service, which will not be the case in the following demo use cases.

• ESB Service Registry should be green if you started the Talend ESB and its Infrastructure Services.

• Software Update will get green if you start the dedicated Archiva Artifact Repository, which will not be thecase in the following demo use cases. Although Archiva Artifact Repository is deprecated.

1. For the Commandline/primary section of the Talend Administration Center Configuration page,simply start the commandline: cmdline/start_cmdline.bat (Windows) or cmdline/start_cmdline.sh(Linux) if you used the Talend Installer.

If you manually installed the Commandline, go to the directory where you installed it and executecommandline.bat (Windows), or commandline-linux.sh or commandline-linux_x86_64.sh (Linux),depending on your version of Linux.

The Commandline must be started to use the ESB Publisher.

2. For the ESB Publisher and Conductor section of the Talend Administration Center Configuration page,simply start the Talend Nexus Artifact Repository.

The Artifact Repository is provided with the Talend Administration Center. So, if you installed the productvia the Talend Installer, you will find it in the tac folder of your installation, in a Artifact-Repository-Nexus-VA.B.C.D.E subfolder. If you installed the product manually, the Artifact Repository will be availablein the Talend Administration Center package as well (Talend-AdministrationCenter-rXXXXXX-VA.B.C).

Page 24: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the Talend Administration Center

20 Talend ESB Getting Started Guide

From the Artifact-Repository-Nexus-VA.B.C.D.E directory, run:

• ./bin/nexus console (Linux)

• .\bin\nexus.bat console (Windows).

It will now be running on http://localhost:8081/nexus/index.html. Replace localhost and 8081with the IP address and the port of the server on which you installed the Artifact Repository. You can log inwith the default login and password: admin/admin123

3. Configure the Log4j parameters by filling in the path to technical and business log files.

The Technical logstash appender parameter will get green when you will start the Talend Log Server, byexecuting start_logserver.bat (Windows) or start_logserver.sh (Linux).

4. Configure the Svn parameters by filling in the connection information to your svn.

To do so, you have to first install a subversion server if you are on Windows, as Linux embeds subversion,and create two repositories in your subversion server: one for your Talend projects, and one for the externallibraries that will get downloaded when starting the Studio.

Then, fill in the connection information to those two repositories in the Svn configuration entry in the TalendAdministration Center.

2.4.2.3. Getting started with the Talend Administration Center

Now that the Talend Administration Center is started and configured, you can use its administration functionalities.

Setting up your first user and project

1. Click the Users link in the left-hand menu, and in the Users page, create a new user.

2. Click the Add button.

Page 25: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the Talend Administration Center

Talend ESB Getting Started Guide 21

3. Fill in the Data panel to the right with your Talend Administration Center and Svn credentials.

Make sure to assign both Designer and Operation manager roles to the account, to be able to respectivelyuse the Studio and manage the deployment of ESB artifacts from the Talend Administration Center.

4. Click Save. The new account you created displays on the list.

5. Click the Projects link in the left-hand menu, and in the Projects page, create a new project.

6. Click the Add button.

7. In the Project panel to the right, put the name of your project in the Label field.

8. Click Save. The new project you created displays on the list.

9. Click the Project authorizations link in the left-hand menu, and in the Project authorizations page, giveaccess right to the project to the user account you just created.

10. In the Project panel to the left, click the project to select it.

11.In the User Authorizations panel to the right, click the Read write icon of the user: .

Page 26: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the Talend Studio

22 Talend ESB Getting Started Guide

Now, you will be able to connect to this project.

2.4.2.4. Connecting the Talend Runtime to the TalendAdministration Center

To do so, you have to be logged in as a user with an Operation manager role. So, if you are logged in asAdministrator with the [email protected] account, log out and log in again with the user you created inGetting started with the Talend Administration Center.

1. Click the Servers page in the menu to the left to display the list of servers.

If you installed the product via the Talend Installer, depending on your license, one server, the Jobserver,might already be installed and display by default: serv1.

2. Create a new server by clicking Add > Add server. The Execution server form displays to the right.

3. Fill in the form as below and click Save:

• Label: Talend Runtime Container, for example.

• Host: 127.0.0.1

• Select the Talend Runtime check box.

2.4.3. Starting the Talend Studio

If you are a user of the Enterprise or Platform products, you first need to follow the instructions described inStarting the Talend Administration Center.

2.4.3.1. Launching the Studio

1. Launch the executable file corresponding to your operating system, for example:

• TOS_ESB-win-*.exe (Windows) or TOS_ESB-linux-gtk-* (Linux) for Talend Open Studio for ESB.

• Talend-Studio-win-*.exe (Windows) or Talend-Studio-linux-gtk-* (Linux) for an Enterprise orPlatform Studio.

2. For the Enterprise or Platform product, if you manually installed the Studio, you will be asked to load alicense file at this point. Browse to where your license file is located, and click OK to load it.

Page 27: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the Talend Studio

Talend ESB Getting Started Guide 23

2.4.3.2. Logging in to the Studio

For Talend Open Studio for ESB

No connection information is required. As first time user, you will be directly asked to import a demo project orcreate a new one.

1. Create a new project:

In the Talend Studio login screen, put the name of your project in the Create a New Project field and clickCreate.

2. The [New project] wizard opens for the project details. Do not hesitate to add a description of your project.

Click Finish. The login screen displays again but with this new project. Click Open.

The [Connect to TalendForge] wizard displays.

3. If you have already registered to the TalendForge (tutorials, support, and so on), connect to it here. If not,please enter your details to create an account. You can also Skip this step for the moment.

4. The [Welcome] page in the Talend Studio is now displayed while the initialization of the studio finishes.

Click the [x] button of this [Welcome] page to close it and access the Talend Studio main screen.

Page 28: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the Talend Studio

24 Talend ESB Getting Started Guide

For Enterprise and Platform Studio

From the Enterprise or Platform Studio, connect to the project you created in the Talend Administration Center.

1. Create a new connection based on the account you created in the Talend Administration Center:

Click the [...] button next to the Connection list. The [Connection] wizard displays.

2. In the Repository list, select Remote.

3. In the Name field, put the name you want to give to that connection.

4. In the User E-mail and User Password, fill in the credential of the user account created in the TalendAdministration Center.

5. In the Web-app Url, put the URL address of the Talend Administration Center.

6. Click the Check url button to check that the connection to the Talend Administration Center is successful.

7. If the connection is successful, click OK to create the connection.

8. In the Talend Studio login screen, the fields are filled in with the connection information.

In the Project and SVN Branch lists, all the projects and their branches to which you have access and canwork on should be listed.

Here, as you only created one project and did not create any branch in it, you have nothing to select.

9. Click Open to open the project.

The [Connect to TalendForge] wizard displays.

Page 29: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Starting the ESB dashboards

Talend ESB Getting Started Guide 25

10. If you want to connect to the Talend online community and benefit from it, create or connect to it from thiswizard. You can also Skip this step.

11. To finish the starting up of the studio, you will be asked in a [Additional Talend Packages] wizard toinstall required and optional third-party libraries. Please do so to be able to fully benefit from the studio'sfunctionalities. So, make sure the Required and Optional third-party libraries check boxes are selectedand click Finish.

12. In the [Download external modules] wizard that displays, click the Accept all button at the bottom of thewizard to accept all the licenses of the external modules used in the studio.

13. A [Migration tasks done] wizard displays informing you of possible migration tasks, simply click OK toclose the wizard.

14. The [Welcome] page in the Talend Studio is now displayed while the initialization of the studio finishes.

Click the [x] button of this [Welcome] page to close it and access the Talend Studio main screen.

2.4.4. Starting the ESB dashboards

If you are an Enterprise or Platform user, you can access to the ESB Dashboards in the Talend AdministrationCenter. Those dashboards gathers logs related to ESB events, to locator endpoints and service availability, and tothe Service Activity Monitoring. This feature is not available in the Talend ESB Standard Edition and the TalendOpen Studio for ESB.

To be able to access it, you first need to start the Talend Administration Center (for more information, see Startingthe Talend Administration Center), and the Talend Log Server.

1. If you installed the product via the Talend Installer, go to the directory named logserv, and double-click thefollowing executable file: start_logserver.bat (Windows) or start_logserver.sh (Linux).

If you downloaded the Talend-LogServer-VA.B.C.D.zip package, unzip it and double-click the followingexecutable file: start_logserver.bat (Windows) or start_logserver.sh (Linux).

2. On the Talend ESB Container console, execute the following commands:

tesb:start-el-server

tesb:stop-el-server

3. Change the configuration of the <TalendRuntimePath>\container\etc

\org.talend.eventlogging.server.cfg file as follows:

persistence.event.db.active.default=false

search.active.default=true

elasticsearch.available=true

4. Go back to the Talend ESB Container console and execute the following command to start again the EventLogging service now that it is correctly set up:

tesb:start-el-default

5. As you used the tesb:start-all command to start all the Infrastructure Services in the Talend Runtimecontainer when first starting it, the Service Activity Monitoring services were started as well. So you nowneed to stop them to only start the Service Activity Monitoring retrieval service that is useful for the ESBDasboards. To do so, execute the following commands:

tesb:stop-sam

Page 30: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Software prerequisites for the Demos

26 Talend ESB Getting Started Guide

tesb:start-sam-retrieval-service

6. Now that all the needed services are started, start the Event Logging listeners for Service Activity Monitoringand Service Locator events via the following commands:

tesb:start-el-samlistener

tesb:start-el-locatorlistener

For more information about the configuration, see the Talend ESB Infrastructure Services Configuration Guideand the Talend Administration Center User Guide.

For more information on how to access the logs generated when executing the examples of this guide, see:Accessing the events in the ESB Dashboards, Accessing the events in the ESB Dashboards, and Accessing all ESBevent logs in Talend Administration Center.

2.5. Software prerequisites for the DemosIn addition to the prerequisites in Prerequisites to using Talend ESB products, there is one extra piece of softwareneeded to run the demos.

Apache Maven 3.0.3 is used to build the "export the service" part of the SayHello example (see Exporting theservice and running it in a Talend Runtime container) and all of the Rent-a-car demos. So, Apache Maven shouldbe downloaded from http://maven.apache.org/ and installed, and the mvn executable should be in your Pathenvironment variable.

When running mvn for the first time, HTTP access to the Internet is required, in order to download the requiredartifacts (and subsequently to get the most recent versions). The local Maven repository is expected to be createdin its default location, that is, the standard Maven configuration should not be modified.

Page 31: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB Getting Started Guide

Chapter 3. Basic deployment and runtimeuse casesThis chapter will help you to get up and running with the Talend ESB products with different demo use cases.

• With the Building and deploying Data Services and Routes using the Studio, you will learn how to create routesand services in the Talend Studio and how to deploy them into the Talend Runtime.

• With the Building and deploying REST Services using the Studio, you will learn how to create a REST servicein the Talend Studio, how to deploy it into the Talend Runtime and how to call it via a REST consumer Job.

• With the Building and deploying Data Services and Routes using Java, you will learn how to compile ApacheCXF services and deploy them into the Talend Runtime.

• With the Importing the Rent-a-Car Java demo into Eclipse, you will learn how to import services as a projectinto Eclipse.

For more use cases about creating services, routes and data service jobs with the Talend Studio and deploying theminto the Talend Runtime, testing the service with a soapUI project, and unit testing the route using the ApacheCamel Testing framework, see the Theory into practice appendix for ESB in the Talend Studio User Guide.

For more use cases on how to publish and execute a service, a route and a data service job, and how to monitor theservice endpoints and service activities in the Talend Administration Center, see the Theory into practice appendixfor ESB in the Talend Administration Center User Guide.

Page 32: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building and deploying Data Services and Routes using the Studio

28 Talend ESB Getting Started Guide

3.1. Building and deploying Data Servicesand Routes using the StudioThis section will help you to get up and running with the Talend Studio. You see how to build a simple SayHelloexample, using pre-defined templates.

If you are only interested in Java-based ESB development, you can skip this section and continue to the Building anddeploying Data Services and Routes using Java

Here are the steps involved in the SayHello example:

1. Install the Talend Studio (Starting the software).

2. Build a simple SayHello data service, in which a consumer sends a number of names to a service, which thenprints "Hello!" to each of them in turn.

3. Build a simple SayHello route.

This section gives enough information to create and run the demo. For a comprehensive look at the Talend Studio UserInterface, please see the Talend Studio User Guide.

For more details on specific components mentioned in this demo, please see the Talend Components Reference Guide fordata services components and Talend ESB Mediation Components Reference Guide for mediation components.

3.1.1. Building a simple SayHello data service

There are a number of parts involved in creating this service, which you implement by dragging and droppingexisting functionalities.

1. Create a SayHello provider.

2. Create a SayHello consumer.

3. Export the service to a Talend Runtime container, and run the consumer again.

3.1.1.1. Creating a SayHello provider

This section provides you a step by step instruction to build the SayHello provider.

Creating a service

In this section, you will create a WSDL which defines the external contract to the Web service that clients canuse. (See Web Services Support for more information).

1. To create the service, right-click Services in the left hand menu and select Create Service.

Page 33: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

Talend ESB Getting Started Guide 29

2. Enter the name SayHelloService, purpose Demo and a description of the service, and click Next.

3. In the next step called [Assign WSDL], select Create new WSDL and click Finish to return to the mainscreen.

4. Now the main window has a [SayHelloService_0.1.wsdl] tab displayed. This WSDL containsa new port (SayHelloServicePort) for the service, and default request and response operations(SayHelloServiceOperationRequest and SayHelloServiceOperationResponse respectively). Hover overthe grey arrows to the right of the operations to display their parameters:

Page 34: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

30 Talend ESB Getting Started Guide

It is possible to make changes to the operations - add new operations and edit existing ones. However, thedefault operations are enough for this demo example.

Configuring and exposing a service

To modify the grid components in the following sections:

• Click on the border of a square to move the shape itself around the grid.

• Undo or edit these changes by right-clicking the square and selecting the appropriate actions.

• Click the center of a square for actions particular to the component (for example, examining details of the component).

1. Save the service details and WSDL Request / Response data types to the Metadata so that they can beaccessible to other components. So, in Services, right-click SayHelloService 0.1 and select Import WSDLSchemas.

Page 35: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

Talend ESB Getting Started Guide 31

This option imports the WSDL metadata from the service into the Repository, under the Metadata > Filexml. This allows you to share the operations details across services and other components.

2. Implement the operation - expand the elements displayed in SayHelloService 0.1, right-clickSayHelloServiceOperation 0.1 and select Assign Job. In the wizard, select Create a new Job and Assignit to this Service Operation, and click Next.

Keep the default name and prefix SayHelloServicePortType_SayHelloServiceOperation, and click Finish.This creates a new job, which allows to implement the operations using components in the main grid.

3. The default template of the SayHelloServicePortType_SayHelloServiceOperation Job is made of thetESBProviderRequest and the tESBProviderResponse components. Separate the two ESB components onthe grid by clicking on the tESBProviderResponse_1 icon, and dragging it further to the right.

Page 36: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

32 Talend ESB Getting Started Guide

4. Now add some business logic. tXMLMap is a component that transforms and routes data from single ormultiple sources to single or multiple destinations. Perform a search for the tXMLMap component in thePalette on the right hand side. There may be two instances found under different sections, but they are boththe same, so select either. Drag and drop it between the two ESB components.

5. Right-click the center of tESBProviderRequest_1 and select Row, then Main and drop the end of the lineon tXMLMap_1.

6. Next, right-click tXMLMap_1 and select Row, then Main and drop the end of the line ontESBProviderResponse_1. Give it the name Response, and click OK. Click the default Yes when asked ifyou wish to import the schemas.

Configuring the service operation

1. Now customize the service operation to match the scenario. Double-click tXMLMap_1 to open its editor.tXMLMap is used to route the information from the request to the response, and make use of the existingschema information from the WDSL.

2. Under main :row1 on the left hand side, right-click payload and select Import from Repository. In the[Metadata] wizard that appears, navigate from File XML to SayHelloServiceOperationRequest0.1, selectit and click OK.

3. In the same way, on the right hand side, import the default response type, right-click payload then Importfrom repository > File XML and select SayHelloServiceOperationResponse 0.1.

Page 37: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

Talend ESB Getting Started Guide 33

Click OK.

So, the request and response operations are implemented from the existing schemas.

4. Next, simply link the request schema to the response one: left-click in on the left hand side and drag it to theout expression in the response on the right hand side.

5. Next, modify the default expression that is sent. On the right hand side, under Expression, click theHelloServiceRequest value, and click the [...] button beside it. Edit the expression (which will evaluate to aname) by clicking in the field, and add "Hello " + before it, and +"!" after it.

Click OK. You will see the updated expression now on the right hand side. Click OK to return to the mainJob design window.

6. Finally, in order to see more as the Job executes, add a logging component. This is done simply by searchingfor tLog in the palette, and dragging tLogRow from the Palette on the right hand side and dropping it on theResponse link between the tXMLMap_1 and tESBProviderResponse_1.

Page 38: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

34 Talend ESB Getting Started Guide

Now, the implementation of the SayHelloServiceOperation is complete.

Running the service in the Talend Studio

Do a quick check now to make sure this part is working, by clicking the tab Run (Job SayHello...) in middlesection in the bottom half of the window, and then clicking the Run button.

The Job is compiled, and the log output shows that the Web service has been assigned a port 8090 and has beenpublished for other services to use.

Select and copy "http://localhost:8090/services/SayHelloService" for later use.

In Talend Studio you can test each Service operation which you implement in a Job Design individually to check that itsimplementation is ok. If you would like to test the entire service with multiple operations, you need to export the serviceand deploy in the runtime. It is not possible to test a service with multiple operations in the Talend Studio.

3.1.1.2. SayHello consumer

In this section, you will see how to create the SayHello consumer, and call the service with it.

Page 39: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

Talend ESB Getting Started Guide 35

Creating the SayHello consumer

1. To test the service, you can also create a small consumer Job. Right-click Job Designs and select CreateJob. In the Name field, type SayHelloConsumer, and the purpose is Demo. Click Finish.

2. Now in the [Job SayHelloConsumer 0.1] tab, search for tFixedFlowInput in the palette, and drag and drop itonto the grid. Similarly, drag and drop tXMLMap, tESBConsumer, and tLogRow (twice) as shown below.

The tFixedFlowInput components generates as many lines and columns as you want using context variables,and the tESBConsumer calls a specified method from the invoked Web service, and returns a class, basedon parameters.

3. Now configure the components. Double-click the center of tFixedFlowInput_1 and in Component tabbelow, select Use Inline Table. Then click the [...] button next to Edit schema to open the Schema editingwindow.

In this window, click [+] to add a string argument, and rename newColumn to Name and click OK to closethis window.

4. Returning to the tFixedFlowInput_1 Component tab, use the [+] button to add sample rows, andsuccessively replace the "newLine" text with names "Peter", "Alice" and "Bob".

Page 40: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

36 Talend ESB Getting Started Guide

This is the example data that the consumer will send to the SayHelloService.

5. Now, in the Job SayHelloConsumer 0.1 Job, link the components as before, by right-clicking and draggingtFixedFlowInput_1 > row > main to tXMLMap_1. Then right-click tXMLMap_1 > row and name thisnew Output Request (click the default yes to get the schema of the target component), and drop the end ontESBConsumer_1.

6. Now double-click the tXMLMap to configure it as before. On the right hand side, click payload> Import From Repository. In the [Metadata] wizard that appears navigate from File XML toSayHelloServiceOperationRequest 0.1, and select it. This enables you to call the service operation. ClickOK.

7. Now left-click and drag Name on the left hand side to the in parameter on the right hand side and click OKto return to the main window.

8. Finally, take care of the response outputs. Right-click the center of tESBConsumer_1, drag and select Row> Response and drop the end on tLogRow_1 so that any responses should go there. Similarly, right-clicktESBConsumer_1, select Row > fault and drop the end on tLogRow_2 so that any faults should go there.

Page 41: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

Talend ESB Getting Started Guide 37

Now, the consumer Job configuration is complete.

In summary, tFixedFlowInput generates "Peter", "Alice", "Bob", these will be passed by tXMLMap totESBConsumer, which will do three corresponding invocations on the target provider.

Running the consumer

1. Now, point the consumer at the correct WSDL endpoint for the Service. So go to the Component tab ofthe tESBConsumer component, and edit the endpoint there to reference the correct service. Click the [...]button next to Service Configuration, and the WSDL configuration window opens. Paste in "http://localhost:8090/services/SayHelloService" to replace the service address there, giving a full addressof "http://localhost:8090/services/SayHelloService?WSDL" and click the refresh button to theright to load the information. Click Finish.

2. Finally, run the consumer Job. Click the Run (Job SayHelloConsumer) tab, and click Run. The Job buildsand executes, and the three names in a Hello message display in the output.

Page 42: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

38 Talend ESB Getting Started Guide

So, the creation and execution of a SayHello consumer and provider in Talend Studio is successful.

3.1.1.3. Exporting the service and running it in a Talend Runtimecontainer

In this section, you will see how to export the SayHello service to run it in an OSGi container, the Talend Runtimecontainer.

1. Before exporting the service, first start a Talend Runtime container, and make sure all its InfrastructureServices have been started, as described in Starting Talend Runtime.

2. For Enterprise and Platform users who want to see the Service Activity Monitoring and Service Locator eventsgenerated when executing this SayHello use case in the Talend Administration Center ESB Dashboards, makesure to start them as described in Starting the ESB dashboards.

3. Additionally, for Enterprise and Platform users who want to use the ESB Dasboards, you need to configuresome settings before exporting the service. Under Services, right-click SayHelloService 0.1 and select ESBRuntime Options. In the dialog box, select the Use Service Activity Monitoring and Use Service Locatorcheck boxes.

4. Now export the service. Under Services, right-click SayHelloService 0.1 and select Export Service. In the[Save As] window, specify a folder. Click Finish.

This process builds and exports the service to the specified directory, as a SayHelloService-0.1.kar file.

5. Copy the SayHelloService-0.1.kar file, and paste it into the deploy folder of the Talend Runtimecontainer, The service starts directly.

Enterprise and Platform users can also deploy the service via the Talend Administration Center Webapplication, for more information, see Publishing and deployment from the Talend Administration Center.

6. Since this is a dynamic loading environment, the service starts running automatically. To see it in the TalendRuntime container window, type in the list command at the console prompt.

Page 43: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple SayHello data service

Talend ESB Getting Started Guide 39

7. To check if the service has correctly been deployed, go to http://localhost:8040/services, and theSayHelloService service will be listed.

8. Now check it is working, by starting the consumer.

The port that the service is running at has changed, and now uses the Talend Runtime container port, whichis by default 8040, so update the port. Under Job Designs, open the SayHelloConsumer 0.1 Job. Click themiddle of tESBConsumer_1. Then go to the Component tab.

9. Click the [...] button next to Service configuration, which opens a WSDL settings window.

10. Update the port number to use the Talend Runtime container port - so change 8090 to 8040, and click therefresh button.

11. Now run the consumer job as before from the Run tab, and you see the same output as before.

12. If you look at the output in the Talend Runtime container, you also see the Hello messages generated by theserver running in the container.

Page 44: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing the events in the ESB Dashboards

40 Talend ESB Getting Started Guide

So that is how to create a simple SayHello consumer and service, running them in the Talend Studio, and alsorunning the service in the Talend Runtime container.

3.1.2. Accessing the events in the ESB Dashboards

For Enterprise and Platform users, once you deployed the SayHelloService service with the Service ActivityMonitoring and Service Locator options enabled and requested it via the SayHelloConsumer, you will be able tosee events in the Talend Administration Center ESB Dashboards.

In the Talend Administration Center Web application, click Monitoring > Logging in the menu tree view:

To access the event logs about the service endpoints, click the ESB Locator Endpoints dashboard:

Page 45: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing the events in the ESB Dashboards

Talend ESB Getting Started Guide 41

To access the event logs about the service activity, click the ESB SAM dashboard:

For more displays of the ESB Dashboards, see Accessing all ESB event logs in Talend Administration Center.

Page 46: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

SayHelloRoute example

42 Talend ESB Getting Started Guide

3.1.3. SayHelloRoute example

In this example, you will see how to extend your existing SayHello consumer and provider. You will have twoinstances of the provider, and using the Mediation perspective, you will build a route that filters the Hello messagesby name, so that messages with the name "Alice" in them go to one provider, and other names go to the secondprovider.

Finally, you will run the consumer from the first example, and show the messages coming from the consumer,and being routed to the correct service.

3.1.3.1. Creating the route

1. First, switch from the Integration perspective to the Mediation perspective by clicking Mediation in thetop right hand corner.

2. Create a new route by right-clicking Routes > Create Route. Give the name SayHelloRoute and purposeis Demo, and click Finish.

The Route SayHelloRoute 0.1 tab opens.

3. Now you will notice that the palette has changed from the one in the Integration perspective to the Mediationperspective. You will create a typical content-based route, dragging and dropping components from the paletteto the route grid.

The request message is coming in from the consumer, so drag and drop the Messaging > cCXF component,which intercepts messages coming into server endpoints.

Then, as you want to create a content-based route, drag and drop the Routing > cMessageRouter component,which reroutes messages depending on a set of conditions.

Then add two more instances of Messaging > cCXF for the two target services.

Page 47: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

SayHelloRoute example

Talend ESB Getting Started Guide 43

Having multiple cCXF components with the same label in a Route is not supported.

It is recommended to label each component with a unique name to better identify its role in the Route.

Having duplicate labels may cause problems for the code generation of some components.

4. To implement this, just add some parameters. So, click cCXF_1, and then click the Component tab below:

• As a Talend Open Studio for ESB first time user, you will be asked to install external libraries in the Studioto be able to use some components as the cCXF, so please follow the instructions and install them.

• In the Address field, paste in the previous service address "http://localhost:8040/services/SayHelloService", and update the port to be 8042, since the new service will be listening on this port. So,you get the following new service address "http://localhost:8042/services/SayHelloService".

• In the Wsdl File field, specify the URL of the WSDL from the original service. Use the http://address to get the live background service information. It is in "http://localhost:8040/services/SayHelloService?WSDL", for all three services.

• In the Dataformat list, select PAYLOAD, as you are looking at the message body.

At any point, you can save the current information by selecting File > Save or clicking the Save icon in the top lefthand corner.

5. Repeat the previous step for the other components: cCXF_2 - except that the port number in the Addressfield is 8040, and for cCXF_3 where the port number in the Address field is 8041.

So, in summary, you create a request on port 8042 (cCXF_1), and send it to either port 8040 (cCXF_2) or8041 (cCXF_3), depending on the contents of the message.

Page 48: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

SayHelloRoute example

44 Talend ESB Getting Started Guide

6. So now, connect the components together. Connect cCXF_1 to cMessageRouter_1 by right-clicking thecenter of cCXF_1 and selecting Row > Route and dropping the end onto cMessageRouter_1.

7. Then create a When trigger for one service, by right-clicking cMessageRouter_1, selecting Trigger > Whenand dropping the end on cCXF_2.

8. Similarly, add an Otherwise trigger from cMessageRouter_1 to cCXF_3 by right-clickingcMessageRouter_1, selecting Trigger > Otherwise and dropping the end on cCXF_3. This results in thefollowing:

9. Configure the When condition: right-click the when1 line, which brings up a small dialog.

In the Type list, select simple, and the Condition is "${bodyAs(String)} contains 'Alice'".

This way, any message with "Alice" in the body will be routed to a service in a Talend Runtime containerthat listens on port 8040.

3.1.3.2. Running the services

1. First, you must have created a second, alternate container - see Creating an alternate container for the Demosfor details, and started all its Infrastructure Services (tesb:start-all). Also, check that the default containeris running - restart it if necessary, and start the alternate container.

2. Then copy of the kar file of the service you created (Talend ESB installation directory /container/deploy/SayHelloService-0.1.kar), and paste it into the deploy folder of the alternate container.

3. To test that all has been configured correctly, before adding the consumer, go to the route created in the studioand execute it. Click the Run button in Run (Job SayHelloRoute) tab:

Page 49: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

SayHelloRoute example

Talend ESB Getting Started Guide 45

This checks that the CXF configuration information is syntactically correct. It also gives an output of "0rows" on the grid, which reflect the flow of messages, so that you know that the parts are connecting. Leavethe job running.

If you get syntax errors, then click on each component in turn, and examine it in the Component tab. Check inparticular that the double quotes are all there, and that the port numbers are correct.

4. Now, switch back to the consumer to run the demo for real. Click Integration perspective in the top righthand corner. Then open the SayHelloConsumer 0.1. Update the port number, so click the Component tabof the tESBConsumer, and the [...] button next to Service Configuration. Update the port number to be8040, and click the refresh button to retrieve the WSDL information. Now update the endpoint to be that ofthe route - http://localhost:8042/services/SayHelloService.

5. Now send a request by running the consumer job by clicking on the tab Run (Job SayhelloConsumer) andclick Run. The "Hello Peter", "Hello Alice", "Hello Bob" display in the consumer output as before. The maingrid shows "3 rows", that is, the three messages being passed along with none going to fault.

Page 50: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

SayHelloRoute example

46 Talend ESB Getting Started Guide

6. Now look at the Route SayHelloRoute 0.1 tab, 1 message went to the cCXF_2 provider and 2 messageswent to the cCXF_3 provider.

7. And if you look at the output in the two containers, you also see that the messages have been routed correctly.This is the output for one container:

This is the output for the other:

That is the SayHelloRoute demo completed.

3.1.3.3. Exporting Routes

You can export routes as ESB Runtime kar files. In the Mediation perspective, under Routes, right-clickSayHelloRoute 0.1, and select Build Route.

Page 51: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building and deploying REST Services using the Studio

Talend ESB Getting Started Guide 47

Specify a path for the kar file.

This screen shows the route being exported to a /container/deploy directory in a Talend Runtime so that it isdirectly deployed, but it can also be stored elsewhere and copied to the deploy directory later.

3.2. Building and deploying REST Servicesusing the StudioThis section will help you to get up and running with the Talend Studio by showing you how to build a simpleREST service example.

If you are only interested in Java-based ESB development, you can skip this section and continue to the Building anddeploying Data Services and Routes using Java

Here are the steps involved in the REST demo example:

1. Install the software as described in Downloading and installing the software and run it as described in Startingthe software.

At least, both the Talend Studio and the Talend Runtime should be started.

2. Build a simple REST service that will explore the data of a simple database table containing informationabout employees.

Page 52: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

48 Talend ESB Getting Started Guide

However, for the sake of the demo, the following use case will be using a simple tFixedFlowInput componentinstead of a database connection component, but feel free to adapt it to use a database instead if you feelconfortable enough.

3. Deploy the REST service to a Talend Runtime container.

4. Build a simple REST consumer that will send a request to the service.

This section gives enough information to create and run the demo. For a comprehensive look at the Talend Studio UserInterface, please see the Talend Studio User Guide.

For more details on specific components mentioned in this demo, please see the Talend Components Reference Guide.

3.2.1. Building a simple REST service

This section provides you a step by step instruction to build the REST service provider. Unlike SOAP serviceswhich are built via a [Service] wizard, REST services are built through the a [Job Design] wizard of the TalendStudio.

In this section, you will create:

1. A simple REST service provider querying the data of your employees. See Creating a service provider.

2. A second REST mapping to query only one specific employee via their id. See Adding a new mapping to theservice.

3.2.1.1. Creating a service provider

In this section, you will create a REST service giving access to a list of employees and their data. For moreinformation, see Web Services Support.

Creating the Job

1. To create the service, right-click Job Designs in the left hand menu and select Create Job.

Page 53: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

Talend ESB Getting Started Guide 49

2. Enter the name (EmployeeService), the purpose (demo) and a description of the service, and click Finish toreturn to the main screen.

Now, the main screen has a Job EmployeeService 0.1 tab displayed.

3. In this new Job Design, you will build the REST service, so search for tRESTRequest and tRESTResponsecomponents in the palette, and drag and drop them onto the grid.

Similarly, drag and drop tFlowToIterate, tFixedFlowInput, and tXMLMap components as shown below.

Configuring the REST request

1. Double-click the tFixedFlowInput component to display its corresponding Component view at the bottomof the window. Click the [...] button next to the Edit schema option.

Page 54: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

50 Talend ESB Getting Started Guide

In the [Schema of tFixedFlowInput] wizard that pops up, click three times the [+] button at the bottom ofthe wizard to add three columns and configure them as above.

2. In the Mode area, select the Use Inline Content (delimited file) option and paste the following info in theContent field:

1;Lyndon;Monroe2;John;Johnson3;Calvin;McKinley4;Andrew;Truman5;Richard;Taft6;Andrew;Adams7;Herbert;Buchanan8;Bill;Carter9;Ulysses;Jackson10;Warren;McKinley

3. Double-click tRESTRequest to display its corresponding Component view and set its properties.

4. In the REST Endpoint field, you can type in the URI of the endpoint from which the service will beavailable. The URI is generally made of a Host name or IP address and a port number, separated by acolon. Here, put the relative path "/services". This way, the URI will always look as follows: http://<IP_address>:<port_number>/services.

5. Click once the [+] button at the bottom of the REST API Mapping table to add a new mapping.

6. In the HTTP Verb field, leave the GET operation.

7. In the URI Pattern field, type in the XPath to the root of the XML tree: "/employees".

8. Click in the Output Flow field to display the [...] button and click it.

The [Give the name for the schema] wizard pops up.

9. In the Schema Name field, name it getEmployees and click OK.

A new wizard pops up in which you can define the columns of the schema you are about to create.

10. As you do not want to define any schema for this REST API Mapping for the time being, simply click OK.

The new getEmployees mapping displays in the REST API Mapping table.

Page 55: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

Talend ESB Getting Started Guide 51

Connecting the components together

1. Right-click tRESTRequest, select Row > getEmployees in the menu and click the tFlowToIteratecomponent.

2. Right-click tFlowToIterate, select Row > Iterate in the menu and click the tFixedFlowInput component.

3. Right-click tFixedFlowInput, hold and drag to tXMLMap.

4. Right-click tXMLMap, hold and drag to tRESTResponse and name the output link all when asked by the[tXMLMap Output] pop-up.

Configuring the tXMLMap

1. Double-click it to open its editor.

2. In the editor, the input flow from the database table displays to the left, in the input area of the editor. And in theoutput area to the right of the editor, configure the output XML flow that will be sent to the tRESTResponsecomponent.

3. In the all output table, right-click the root element and select Rename in the menu to rename it employees.

Page 56: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

52 Talend ESB Getting Started Guide

Now, define the XML tree of the employees root element.

4. Right-click employees and select Create Sub-Element in the menu to create a sub-element called employeethat will hold each employee's information.

5. Right-click this new employee sub-element and select As loop element in the menu.

This way, a loop will be executed at each new employee encountered, to retrieve their individual information.

6. Click the Wrench button at the top of the table to display the output options and select true in the All inone list.

When set to true, the All in one option enables to create one single XML document from all the input rows ofthe tXMLMap component. This allows to send only one complete response when the Web Service is called.

7. Map the input with the output flow, select the id column from the row1 table and drop it onto the employeesub-element of the all table, a [Selection] wizard pops up.

8. In the wizard, select Create as attribute of target node and click OK to validate.

Page 57: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

Talend ESB Getting Started Guide 53

A mapping has been created between the id column of the employees database table and the id attribute ofthe employee XML tree.

9. Select the firstname and lastname columns of the row1 table and drop them onto the employee sub-elementof the all output table.

10. In the [Selection] wizard, select Create as sub-element of target node and click OK to validate.

The mapping between the input and output flow is complete.

11. Click Apply and OK to close the editor and validate the configuration.

Executing the Job

1. Press F6 to run the Job. The Job is automatically saved before being executed. The Run view displays at thebottom of the Studio and the console follows the execution.

The REST Service has been published to the following endpoint: http://127.0.0.1:8090/services, andthe provider continuously listens for request, so if you want to stop it, you will have to click the Kill buttonof the Run view.

2. To check the service, simply go to the endpoint address on which it has been published:http://127.0.0.1:8090/services/employees.

Page 58: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

54 Talend ESB Getting Started Guide

3.2.1.2. Adding a new mapping to the service

In the previous section (Creating a service provider), you saw how to create a REST service retrieving all theemployees' information. Now, to be able to browse each employee's information individually, you will have toadd a new REST mapping.

Modifying the REST request

1. In the EmployeeService Job, double-click the tRESTRequest component to display its correspondingComponent view and change its properties.

2. Click once on the [+] button at the bottom of the REST API Mapping table to add a new mapping.

3. In the HTTP Verb field, leave the GET operation.

4. Leave the URI Pattern field as is for the moment.

Page 59: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

Talend ESB Getting Started Guide 55

5. Click in the Output Flow field to display the [...] button and click it.

The [Give the name for the schema] dialog box pops up.

6. In the Schema Name field, name it getEmployee and click OK.

7. In the schema wizard, click the [+] button once to add a new line to the table.

Rename it id and change its Type to Integer. Click OK to validate.

The new getEmployee mapping displays in the REST API Mapping table.

8. In the URI Pattern field, type in the XPath to the root of the XML tree followed by the id variable to eachemployee: "/employees/{id}".

9. Duplicate the tFixedFlowInput and tRESTResponse component, simply by coping and pasting them.

10. Click on the workspace, and start typing the name of the tXMLMap component, where you want to add it,in the text field that appears automatically, and double-click its name to add it on the workspace.

Page 60: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

56 Talend ESB Getting Started Guide

Connecting the components together

1. Right-click tRESTRequest, select Row > getEmployee in the menu and click the second tXMLMapcomponent.

2. Right-click the second tFixedFlowInput component, hold and drag to the second tXMLMap.

3. Right-click the second tXMLMap component, hold and drag to the second tRESTResponse component andname the output link single when asked by the [tXMLMap Output] pop-up.

Configuring the second tXMLMap

1. To configure the second tXMLMap, double-click it to open its editor.

2. Select the id column of the getEmployee input table and drag it to the id column of the row2 table.

Page 61: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

Talend ESB Getting Started Guide 57

A purple arrow is created between the columns of the tables to represent the join.

3. Define the XML schema that will be sent to the tRESTResponse component. To do so, right-click the rootelement node in the single table and select Rename in the menu to rename it employee.

4. Map the input with the output flow. To do so, select the id column from the row2 table and drop it onto theemployee element of the single table, a [Selection] wizard pops up.

5. In the wizard, select Create as attribute of target node and click OK to validate.

6. Now, select the firstname and lastname columns of the row2 table and drop them onto the employee elementof the single output table.

7. In the [Selection] wizard, select Create as sub-element of target node and click OK to validate.

The mapping between the input and output flow is complete.

8. Click Apply and OK to close the editor and validate the configuration.

Page 62: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

58 Talend ESB Getting Started Guide

Executing the Job

1. Press F6 to run the Job. The Job is automatically saved before being executed. The Run view displays at thebottom of the Studio and the console follows the execution.

The REST Service has been published to the following endpoint: http://127.0.0.1:8090/services, andthe provider continuously listens for request, so if you want to stop it, you will have to click the Kill buttonof the Run view.

2. To check the service, simply go to the endpoint address on which it has been published:http://127.0.0.1:8090/services/employees.

Page 63: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST service

Talend ESB Getting Started Guide 59

You can see that it looks just like in the previous scenario.

3. Now, if you add the id of one of the employees at the end of the URL: http://127.0.0.1:8090/services/employees/1

Page 64: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

60 Talend ESB Getting Started Guide

Only the information about this employee displays.

3.2.2. Deploying the REST service

Before being able to call the REST service you created in the previous sections via a consumer Job, you first haveto deploy it in your Talend Runtime.

To be able to do this deployment:

1. Make sure your Talend Runtime is up and running. To do so, follow the installation and starting instructionsdescribed in Getting started with Talend ESB.

2. For Enterprise and Platform users who want to see the Service Activity Monitoring and Service Locator eventsgenerated when executing the Employee use case in the Talend Administration Center ESB Dashboards,make sure to start them as described in Starting the ESB dashboards.

3. Additionally, for Enterprise and Platform users who want to use the ESB Dasboards, you need to configuresome settings before deploying the service. In the EmployeeService Job, double-click the tRESTRequestcomponent to display its corresponding Component view and change its properties.

Select the Use Service Locator and Use Service Activity Monitor check boxes.

4. Several deployment processes are possible depending on the product you are using and the goal of yourdeployment:

• With the Talend Open Studio for ESB, you will be able to deploy your Services and Routes locally in yourRuntime. For more infomation, see Local deployment (Talend Open Studio for ESB).

This local deployment can also be done via the Enterprise and Platform Studio, however if you do so, youwill not be able to easily share your Service and Route artifacts (as it can be done when publishing them

Page 65: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

Talend ESB Getting Started Guide 61

in the Artifact Repository) or schedule their deployment and running (as it can be done with the TalendAdministration Center).

• With the Enterprise and Platform products, all the development of Services and Routes is done in theStudio by developers, and all the publishing into a centralized Artifact Repository and deployment intothe Talend Runtime container is done from the Talend Administration Center by operation managers. Formore information, see Publishing and deployment from the Talend Administration Center.

• With the Enterprise and Platform products, you can also publish your Services and Routes to the ArtifactRepository directly from the Studio. This should only be done for snapshots, for quick test purposes only.A dedicated repository already exists in the Artifact Repository for this: the Snapshots repository. Formore information, see Publishing from the Enterprise and Platform Studio (for test purpose only).

3.2.2.1. Local deployment (Talend Open Studio for ESB)

1. From the Talend Studio Repository view, under Job Designs, right-click EmployeeService 0.1 and selectBuild Job.

2. In the [Build Job] wizard, make sure the Build type is set to OSGI Bundle For ESB.

3. Click the [Browse...] button to save the service in a specific folder.

4. Click Finish. The service is saved as a EmployeeService.jar file.

Page 66: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

62 Talend ESB Getting Started Guide

5. Copy the EmployeeService.jar file and paste it into the deploy directory of the Talend Runtime container.

Since the Talend Runtime container is a dynamic loading environment, the service starts runningautomatically.

6. From the Talend Runtime container window, type in list.

7. To check the service, simply go to the endpoint address on which it has been published:http://127.0.0.1:8040/services/services/employees.

Page 67: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

Talend ESB Getting Started Guide 63

You can also create a consumer Job to check the service.

3.2.2.2. Publishing and deployment from the TalendAdministration Center

To publish and deploy your Service and Route artifacts, follow the steps described below. For production purposes,you should use the Releases repository of the Artifact Repository instead of the Snapshots one used here for thedemo.

So, in addition to the Talend Runtime, make sure the Talend Administration Center, and the other modules likethe CommandLine, and Talend Nexus Artifact Repository are running, as described in Getting started with TalendESB.

Page 68: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

64 Talend ESB Getting Started Guide

Publishing via the Talend Administration Center

1. From the Talend Administration Center, click ESB Publisher in the menu to the left to display thecorresponding page that will help you find the Services and Routes you developed and published from theStudio.

2. Click the Add button on the top and fill in the [Publish Task] form that displays to right:

3. Click Save. The new artifact displays in the list, as Ready to publish.

4. Select it and click the Publish button. The service will be published in the Artifact Repository right away.

You can also trigger the publishing of your artifact via the Trigger tab at the bottom of the ESB Publisherpage.

Page 69: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

Talend ESB Getting Started Guide 65

To do so, select the task you just created and click Add trigger... > Add CRON trigger in the Trigger tab atthe botton of the page, and fill in the Add Cron trigger form that displays to the right. If you are not familiarwith the CRON syntax, you can use a wizard that will help you fill in all the related fields. So to open the[Cron UI Trigger configuration] wizard, click the Open UI configurer button.

However for the demo, simply use the Publish button to publish your REST service Job.

Once published, the Service displays in the Artifact Repository, under the org/example node. You can clickthe Open Artifact repository button at the top of the ESB Publisher page. This will open the Nexus Webapplication. And in Repositories > Snapshots, you can find your Service artifact:

Page 70: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

66 Talend ESB Getting Started Guide

Deploying via the Talend Administration Center

Once your Service published in the Artifact Repository, you will be able to deploy it into the Talend Runtimecontainer.

1. From the Talend Administration Center, click ESB Conductor in the menu to the left to display thecorresponding page that will help you find the Services and Routes you published in the Artifact Repository.

2. Click the Add button on the top and fill in the Edition form that displays to the right:

Page 71: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

Talend ESB Getting Started Guide 67

3. In the Label field of the Metadata area, name your service deployment task.

4. In the Feature area, click the Select Feature button to open the [Select Feature from Nexus repository]wizard that will help you fill in the following fields of this area.

Page 72: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

68 Talend ESB Getting Started Guide

5. In the Repository list, select snapshots, browse to the Employee Service feature and select it. Click OK andall the Service feature information will be filled in in the form.

6. In the Runtime Config area, select the container on which to deploy the Service in the Server list.

7. Click Save and the Service deployment task will display in the list.

8. Click the Deploy button and the Service will be deployed into the Talend Runtime container specified inthe Server list.

The Last Action column value changes from CREATED to DEPLOYED, and if you type in list in theTalend Runtime container prompt, a new bundle is listed, the Employee Service one:

[ 289] [Active ] [Created ] [ ] [ 80] EmployeeService (0.1.0.SNAPSHOT)

Page 73: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the REST service

Talend ESB Getting Started Guide 69

3.2.2.3. Publishing from the Enterprise and Platform Studio (fortest purpose only)

For test purposes, you can also publish your Services and Routes to the Artifact Repository from the Studio. Forthis, please use the dedicated Snapshots repository of the Artifact Repository.

In addition to the Talend Runtime, make sure the Talend Administration Center, and the other modules like theCommandLine, and Talend Nexus Artifact Repository are running, as described in Getting started with TalendESB.

1. Make sure the Artifact Repository connection preferences are correctly set in the Studio; go to the MenuWindow > Preferences > Talend > Artifact Repository.

2. From the Talend Studio Repository view, under Job Designs, right-click EmployeeService 0.1 and selectPublish.

3. In the [Publish Job into Artifact Repository] wizard, make sure to publish your Job in the Snapshotsrepository (select the Publish as SNAPSHOT check box).

4. Click Finish.

The Service is now available as an artifact in the Snapshots repository of the Talend Nexus ArtifactRepository. You can click the Open Artifact repository button at the top of the ESB Publisher page. Thiswill open the Nexus Web application, and in Repositories > Snapshots, you can find your Service artifact:

Page 74: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST Service consumer

70 Talend ESB Getting Started Guide

Now, you can acces it from your Talend Administration Center application and deploy it into your Talend Runtimecontainer, as described in Deploying via the Talend Administration Center.

3.2.3. Building a simple REST Service consumer

In this section, you will create a consumer that will send a request to the REST service.

Creating the Job

1. Right-click Job Designs in the left hand menu and select Create Job.

2. Enter the name (EmployeeServiceConsumer), purpose (demo) and a description of the Service, and clickFinish to return to the main screen.

Page 75: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST Service consumer

Talend ESB Getting Started Guide 71

3. Now, the main screen has a Job EmployeeServiceConsumer 0.1 tab displayed.

4. In this new Job Design, you will build the REST Service consumer, so search for a tRESTClient componentin the palette, and drag and drop it onto the grid.

5. Similarly, drag and drop tFixedFlowInput, tXMLMap, and tLogRow components as shown below.

Configuring the REST request

1. First, connect the tFixedFlowInput component to tRESTClient so that it automatically gets the schema ofthe target component.

2. Then, double-click the tFixedFlowInput component to display its corresponding Component view at thebottom of the window.

3. Click the [...] button next to the Edit schema option. The [Schema of tFixedFlowInput] wizard pops up.

Page 76: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST Service consumer

72 Talend ESB Getting Started Guide

4. Click once the [+] button at the bottom of the wizard to add a new line named id with Type as Integer andthe Length of 2, as below.

Click OK and propagate the changes.

5. In the Mode area, select the Use Inline Table option and click three time the [+] button to add three lines,and configure them as below:

6. Double-click tRESTClient to display its corresponding Component view and set its properties.

7. Change the URL field to "http://127.0.0.1:8040/services".

8. Change the Relative Path to "/services/employees/"+row1.id.

Connecting the components together

1. Right-click tRESTClient, select Row > Response in the menu and click the tXMLMap component.

2. Right-click tXMLMap, hold and drag to tLogRow and name the output link all when asked by the[tXMLMap Output] pop-up.

Configuring the tXMLMap

1. Double-click it to open its editor.

Page 77: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST Service consumer

Talend ESB Getting Started Guide 73

In the editor, the input flow from the database table displays to the left, in the input area of the editor. Andin the output area to the right of the editor, configure the output XML flow that will be sent to the tLogRowcomponent.

2. In the row2 input XML tree, right-click the root element and select Rename in the menu to rename itemployee, and define the XML tree of the employee root element, that will hold each employee's information.

3. Right-click employee and select Create Attribute in the menu to create an attribute called id in the [CreateNew Attribute] wizard that pops up.

4. Right-click employee again and select Create Sub-Element in the menu to create a new sub-element calledfirstname in the [Create New Element] wizard that pops up.

Repeat that step to create another sub-element called lastname.

5. Map the input with the output flow, select the statusCode column, id attribute, and firstname and lastnameelements from the row2 XML tree and drop them onto the all output table.

Page 78: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building a simple REST Service consumer

74 Talend ESB Getting Started Guide

The mapping between the input and output flow is complete.

6. Click Apply and OK to close the editor and validate the configuration.

7. Double-click tLogRow to display its corresponding Component view and set its properties.

8. Click the Sync columns button to get the schema from the tXMLMap component.

9. In the Mode area, select the Table option.

Executing the Job

• Press F6 to run the Job. The Job is automatically saved before being executed. The Run view displays at thebottom of the Studio and the console follows the execution.

Page 79: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing the events in the ESB Dashboards

Talend ESB Getting Started Guide 75

3.2.4. Accessing the events in the ESB DashboardsFor Enterprise and Platform users, once you deployed the Employee REST service with the the Service ActivityMonitoring and Service Locator options enabled and requested it via the EmployeeConsumer Job, you will be ableto see events in the Talend Administration Center ESB Dashboards.

In the Talend Administration Center Web application, click Monitoring > Logging in the menu tree view:

To access the event logs about the service endpoints, click the ESB Locator Endpoints dashboard:

To access the event logs about the service activity, click the ESB SAM dashboard:

Page 80: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building and deploying Data Services and Routes using Java

76 Talend ESB Getting Started Guide

For more displays of the ESB Dashboards, see Accessing all ESB event logs in Talend Administration Center.

3.3. Building and deploying Data Servicesand Routes using JavaThis section describes the simplest version of the Rent-a-Car demo.

In the course of working through this example you will learn how to:

• Compile and build Apache CXF services (Rent-a-Car).

• Start the Talend Runtime container (Talend's OSGi container).

• Deploy the services using commands at the Talend Runtime container console.

By default, all of the Rent-a-Car demos are enabled with JMX.

The Rent-a-Car demo code can be built with different options (Maven profiles) in order to use additional functionalities,and these are discussed in the next chapter - this section uses the default, basic build.

3.3.1. The Rent-a-Car demo example

The scenario of this demo example is a common business use case: a simplified real-world example from thedomain of car rental companies. This uses the functionality of the Customer Relationship Management (CRM)service to supply information about the customer, and the reservation service to reserve a car.

Page 81: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

The Rent-a-Car demo example

Talend ESB Getting Started Guide 77

Figure 3.1. Rent-a-Car client application and services

3.3.1.1. The Rent-a-Car scenario

In this scenario, there are two main services that will be demonstrated, ReservationService and CRMService.You will create and orchestrate these services with the help of a simple graphical Rent-a-Car client application,simply called the Rental Client.

The Rental Client provides the basic functionality to search for the cars available within a given time period. Toimplement its business logic, the Rental Client calls operations from both the CRM Service and the ReservationService as shown in the diagram below.

1. The search takes into account the status (silver, gold, platinum) of the customer you select. This customerprofile information is passed to the reservation service and is used to determine the outcome of the search.

2. From the list of results, you can select the car that best fulfills the customer requirements and then make areservation simply by clicking on the Book button.

3. At the end of the submission process, the booking confirmation is displayed along with a Reservation ID.

Page 82: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

The Rent-a-Car demo example

78 Talend ESB Getting Started Guide

Figure 3.2. Rental Client service calls

3.3.1.2. The Rent-a-Car demo structure

This section describes the directory structure of the demo; this consists of the two services and a demo application,plus some support files. These are found in the directory <TalendRuntimePath>/examples/talend/tesb/rent-a-car/:

Directory or file name Description

app-reservation/ This directory contains commands and simple UI client which let users invoke theservices step-by-step.

crmservice/ Customer Relationship Management (CRM) Service which implements thegetCRMInformation and getCRMStatus operations.

reservationservice/ Reservation Service which implements getAvailableCars,submitCarReservation and getConfirmationOfReservation operations.

features/ This directory contains the feature files which will be used to install the Rent-a-Car demoto the Talend Runtime container.

soapui/ This directory contains optional project files for the soapUI tool.

pom.xml This file is used by the Maven build process.

settings.xml This file contains advanced functionality (NOT used by basic demo - see Publishing thedemo to the Artifact Repository for details).

Now, the services and client subdirectories:

1. The crmservice:

Page 83: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the demo

Talend ESB Getting Started Guide 79

Directory or file name Description

common/ This directory contains the CRMService.wsdl file which is used to generate the initialcode.

client/ This is an example client application that shows a CXF client invoking the CXFendpoint.

client-sl-sam/ This directory contains the CRMService client enabled to be used in Service Locatorand Service Activity Monitoring scenario.

client-sts/ This directory contains the CRMService client enabled to be used in Security TokenService scenario.

client-all/ This directory contains the CRMService client enabled to be used with all features.

service/ This directory contains CRMService service implementation.

service-endpoint-jmx/ This directory contains the basic CRMService endpoint.

service-endpoint-sl-sam/ This directory contains the CRMService endpoint enabled to be used in ServiceLocator and Service Activity Monitoring scenario.

service-endpoint-sts/ This directory contains the CRMService endpoint enabled to be used in SecurityToken Service scenario.

service-endpoint-all/ This directory contains CRMService endpoint enabled to be used with all features.

2. The reservationservice has the same structure, except that the parts relate to the ReservationService

3. The app-reservation has code to build the commands and simple UI client:

Directory or file name Description

src/ This directory contains the source code.

target/ This directory is the target directory for the build.

pom.xml This file is used by the Maven build process.

3.3.2. Deploying the demo

This section describes how to deploy the Rent-a-Car demo in the Talend Runtime container. This involves anumber of steps as follows:

1. Create an alternate container - see Creating an alternate container for the Demos.

2. Start the primary container - see Starting Talend Runtime.

3. Build the demo - see Building the demo.

4. Deploy the demo services - see Deploying the demo services.

5. Deploy the demo client application - see Deploying the demo client application.

3.3.2.1. Building the demo

In the rest of the documentation, <TalendRuntimePath> will point out to the directory where Talend Runtime is installed.This is typically the full path of either Runtime_ESBSE, TESB_SE-VA.B.C or Talend-ESB-VA.B.C>, depending on theversion of the software that you are using (see Downloading and installing the software). Please substitute appropriately.

The Talend Runtime examples are in the <TalendRuntimePath>/examples/talend directory.

From the base directory of the ESB example, that is <TalendRuntimePath>/examples/talend/tesb/rent-a-car/, the Maven project file pom.xml can be used to build the demo.

1. From a command line console, change the directory to the root directory of the Rent-a-Car example:

Page 84: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the demo

80 Talend ESB Getting Started Guide

cd <TalendRuntimePath>/examples/talend/tesb/rent-a-car/

2. Run the following Maven command: (Maven is invoked identically from a Linux terminal or the Windowscommand line.)

mvn clean install

Now, the demo is built, and OSGi bundles are created for deployment into the Talend Runtime container.

3.3.2.2. Deploying the demo services

Commands in this document refer to version "5.6.2" of the Talend ESB. If you are using another version, replace the versionsub-string .../5.6.2/... by the number of your version.

The demo services feature must be installed in the primary container, and not in the alternate one, because it relieson the primary's port 8040 to be opened for incoming HTTP calls.

1. Add the Rent-a-Car feature location into the primary container of the Talend Runtime(<TalendRuntimePath>/container/).

At the console prompt (karaf@trun>), type the following command:

features:addurl mvn:org.talend.esb.examples.rent-a-car/features/5.6.2/xml

This command allows you to use the relevant bundles directly from the Maven repository where they havebeen installed by the Maven build.

2. Install the Rent-a-Car services feature into the Talend Runtime container.

Type the following command:

features:install tesb-rac-services

3. Check the feature is successfully installed.

Type the following command:

list

You will see the demo bundles in the list of installed bundles. As you can see below, both CRMService andReservationService bundles are installed:

ID State Blueprint Spring Level Name[197] [Active ] [ ] [ ] [ 80] CRMService Common (5.6.2)[198] [Active ] [ ] [ ] [ 80] ReservationService Common (5.6.2)[199] [Active ] [ ] [ ] [ 80] CRMService Service (5.6.2)[200] [Active ] [ ] [Started] [ 80] CRMService Service Endpoint JMX (5.6.2)[201] [Active ] [ ] [ ] [ 80] ReservationService Service (5.6.2)[202] [Active ] [ ] [Started] [ 80] ReservationService Service Endpoint JMX (5.6.2)

3.3.2.3. Deploying the demo client application

The demo Rental Client application can be deployed either in the same container as the services, the primary one,or in the alternate container (the later simulates a more realistic scenario where client and services are in differentcontainers).

Page 85: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the demo

Talend ESB Getting Started Guide 81

1. If the alternate container is used for deployment of the demo application, add the Rent-a-Car feature locationinto this container. The feature location needs to be added only once in each container, even if the container isshut down afterwards and re-started, as state is preserved between runs. However, if you are unsure whetheryou installed a feature already, adding the feature location again will not cause any problems.

At the container prompt, type the following command:

features:addurl mvn:org.talend.esb.examples.rent-a-car/features/5.6.2/xml

If you have already run a previous example, you may need to run the following command in order to ensurethat internal bundle caches are updated:

features:refreshurl

2. Install the Rental Client application feature into the container.

Type the following console command:

features:install tesb-rac-app

3. Check the feature is successfully installed.

Type the following command:

list

You will see the demo bundles in the list of installed bundles:

ID State Blueprint Spring Level Name[197] [Active ] [ ] [ ] [ 80] CRMService Common (5.6.2)[198] [Active ] [ ] [ ] [ 80] ReservationService Common (5.6.2)[199] [Active ] [ ] [Started] [ 80] CRMService Client (5.6.2)[200] [Active ] [ ] [Started] [ 80] ReservationService Client (5.6.2)[201] [Active ] [Created] [ ] [ 80] App Reservation (5.6.2)

3.3.3. Running the demoThis is the sequence of events in the Rent-a-Car demo:

1. A customer enters prerequisite data into a form such as their name, the pick-up and return dates, the preferredrange of rental rates, and submits their query.

2. The application calls the CRMService to retrieve the customer data and customer status information.

3. The customer is presented a list of available cars and selects one car from the list.

4. The application calls the ReservationService to submit the reservation request and then displays a reservationconfirmation notice to the customer.

3.3.3.1. Starting the application

At this point, ReservationService, CRMService, and app-reservation (the client) are already deployed in TalendRuntime. Start the Talend Runtime container console as described previously. If the demo services and the demoapplication are deployed in two different containers, both must be started.

In fact, there are two versions of the Rental Client application: the GUI one and the command line one. Thus, onthe console of the container with the demo application you will see:

Page 86: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the demo

82 Talend ESB Getting Started Guide

---TALEND ESB: Rent-a-Car (OSGi) Commands---car:gui (Show GUI)car:search <user> <pickupDate> <returnDate> (Search for cars to rent, date format yyyy/mm/dd)car:rent <pos> (Rent-a-Car listed in search result of carSearch)

The following sections will deal with the user interface, and running the commands of the Rental Client application.

3.3.3.2. Using the Rental Client GUI

1. To start the GUI, in the Talend Runtime alternate-container console window prompt (karaf@trun>), type in:

car:gui

2.

Select aebert from the User list and click Find to see the results. You will see the list of available cars.

3.

Page 87: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the demo

Talend ESB Getting Started Guide 83

Click the highlighted line or select any other option and click Reserve.

4. You will now see the confirmation page:

Click Close to stop the application.

3.3.3.3. Using the command lines

You can do the exact same reservation via the command lines.

1. To look for a car for a specific user (aebert), in the console, type:

car:search aebert 2014/07/17 2014/07/20

You will see the list of available cars:

Found 5 cars.

Car details1 VW Golf Standard 50.00 75.00 40.002 BMW 320i Sport 60.00 90.00 45.003 Mazda MX5 Sport 65.00 95.00 50.004 Lexus LX400 SUV 85.00 120.00 100.00

Page 88: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Uninstalling the demo

84 Talend ESB Getting Started Guide

5 Mercedes E320 Delux 95.00 140.00 100.00

2. Now, in the console type: car:rent 2 to rent the second car.

You can now see the confirmation:

Your reservation is booked!

Reservation ID SGA-295484

Customer details----------------Name: Andrea EberteMail: [email protected] City: MunichStatus: PLATINUM

Car details-----------Brand: BMW Model: 320i

Reservation details-------------------Pick up date: 2011/07/17Return date: 2011/07/20Daily rate: 60.00Weekend rate: 90.00Credits: 210Thank you for renting a car with Talend ESB :-)

3.3.4. Uninstalling the demo

This section describes uninstalling the demo, from the container, and from the alternate-container if you used one.

• If you want to uninstall only the demo services, execute this command at the container console:

features:uninstall tesb-rac-services

Then, you can install them again as described in Deploying the demo services.

• If you want to uninstall only the demo application, execute this command at the container console:

features:uninstall tesb-rac-app

Then, you can install it again as described above.

• If you want to uninstall all the demo features, execute the following commands at the containers' console:

features:uninstall tesb-rac-services

features:uninstall tesb-rac-app

features:uninstall tesb-rac-common

Then enter features:list | grep tesb-rac to ensure that all features have actually been uninstalled. Youshould see this in the console:

[uninstalled] [5.6.2 ] tesb-rac-common repo-0[uninstalled] [5.6.2 ] tesb-rac-services repo-0

Page 89: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Importing the Rent-a-Car Java demo into Eclipse

Talend ESB Getting Started Guide 85

[uninstalled] [5.6.2 ] tesb-rac-app repo-0

You can also remove the Rent-a-Car feature location from the container(s).

At the containers console prompt, type the following command:

features:removeurl mvn:org.talend.esb.examples.rent-a-car/features/5.6.2/xml

3.4. Importing the Rent-a-Car Java demo intoEclipseIn this section, you will use the Maven Eclipse Plugin ( http://maven.apache.org/plugins/maven-eclipse-plugin/)to generate the Eclipse project files for the Rent-A-Car example. (The Talend ESB Development Guide describeshow to install this plugin).

3.4.1. Building the project files

1. Go to the base directory of the Talend ESB example <TalendRuntimePath>/examples/talend/tesb/rent-a-car.

2. If you have not built the demo yet, run:

mvn clean install

3. Then run:

mvn eclipse:eclipse

The Eclipse project files will now be created.

3.4.2. Importing into Eclipse

In the Eclipse IDE:

1. From the main menu bar, select File > Import.... The [Import] wizard opens.

2. Select General > Existing Projects into Workspace and click Next.

3. Choose Select root directory and click the associated Browse to locate the examples/talend/tesb/rent-a-car directory.

4. Back in the [Import Projects] window, under Projects, select the project or projects that you would like toimport, and then click Finish.

The Talend ESB example projects you selected will be imported into your Eclipse workspace. At this stage, youcan now see the source code, modify it, and take advantage of all other Eclipse features.

3.4.3. Running the examples

Typically, the examples will still be run using Maven commands from a command-line window. If desired, Eclipseplugins for Maven exist to allow for running Maven commands within the IDE.

Page 90: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the examples

86 Talend ESB Getting Started Guide

For more information on developing with Talend ESB and Eclipse, please see Talend ESB Development Guide.

Page 91: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Talend ESB Getting Started Guide

Chapter 4. Advanced deployment andruntime use cases with SOA GovernanceThis chapter will help you to use more advanced features of the Talend Runtime, for example Service Locator,Service Activity Monitoring, Security Token Service, etc. It will also show you how to use of a repositorymanagement software for the deployment of services and routes.

The examples showed in this chapter are based on the Rent-a-Car Java demo introduced in the Basic deploymentand runtime use cases.

Page 92: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Rent-a-Car demo using Service Locator and Service Activity Monitoring

88 Talend ESB Getting Started Guide

4.1. Rent-a-Car demo using Service Locatorand Service Activity MonitoringThis section describes how to use both of these features for the Rent-a-Car demo:

• the Service Locator component, to publicly register the service endpoints,

• the Service Activity Monitoring (SAM) to monitor service calls, typically for collecting usage statistics andfault monitoring.

If you have one of the Enterprise or Platform editions of Talend, there is a GUI functionality provided by the TalendAdministration Center, for viewing the Service Locator and Service Activity Monitoring information. For a preview ofthe Service Activity Monitoring User Interface in the Talend Administration Center, see Viewing the events in the ServiceActivity Monitoring interface of the Talend Administration Center.

Please see the Talend Installation and Upgrade Guide and the Talend Administration Center User Guide for more details.

In this section, you will see how to deploy the Rent-a-Car demo in the Talend Runtime container. This involvesa number of steps, similar to those described in the basic Rent-a-Car demo.

1. Create an alternate container - see Creating an alternate container for the Demos.

2. Start the primary container - see Starting Talend Runtime.

3. Build the demo - see Building the demo with Service Activity Monitoring and Service Locator enabled.

4. Check that the features from the previous demo runs have been uninstalled - see Uninstalling previousfeatures.

5. Deploy the Talend ESB services - see Installing and starting the Service Locator and Service ActivityMonitoring .

It is important for the Rent-a-Car demo that these are installed in the default container (using port 8040), asthe demo files are configured for that.

6. Deploy the demo services and client application in one container - see Running the demo in one containerto generate Service Activity Monitoring data. This step focuses more on the Service Activity Monitoringfunctionality, as the Service Locator is largely unused in this scenario.

7. Then re-run the demo using two containers, while stopping one of the example services. This will show therole of the Service Locator in service failover (see Running the demo in two containers - simulating serverfailover with Service Locator), and show how the client re-connect to another service, using this functionality.

4.1.1. Installing and starting the Service Locator andService Activity Monitoring

In order to enable the Service Locator and the Service Activity Monitoring for the Rent-a-Car example, they haveto be installed and deployed in the Talend Runtime container.

If you started the Talend Runtime container and all the Infrastructure Services as described in Starting TalendRuntime, those features should have already been deployed and started through the tesb:start-all command.

If you want to start them individually or customize their configuration parameters, see Service Locator and ServiceActivity Monitoring.

Page 93: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Installing and starting the Service Locator and Service Activity Monitoring

Talend ESB Getting Started Guide 89

4.1.1.1. Service Locator

The Service Locator can be started individually in the Talend Runtime container, simply by typing the followingat the primary container console:

tesb:start-locator

Its configuration parameters are located in the file <TalendRuntimePath>/container/etc/

org.talend.esb.locator.cfg. Here is an example:

# Configured zookeeper endpoints (divided by a comma if several instances # uses). The service locator client will one by one pick an endpoint to # connect to the service locator until a connection is established. locator.endpoints=localhost:2181

# Endpoint prefix property is needed because we run services in # a container where the endpoints is only relative to the container.endpoint.http.prefix=http://localhost:8040/servicesendpoint.https.prefix=https://localhost:9001/services

locator.strategy=defaultSelectionStrategylocator.reloadAdressesCount=10

connection.timeout=5000session.timeout=5000

For further information about the Service Locator properties configuration, please read the Talend ESBInfrastructure Services Configuration Guide.

4.1.1.2. Service Activity Monitoring

The Service Activity Monitoring Server can be started individually in the Talend Runtime container, simply bytyping the following at the primary container console:

tesb:start-sam

Then, the Service Activity Monitoring Server will be started. you can check with this URL in a browser: http://localhost:8040/services/MonitoringServiceSOAP?wsdl, which should list its <wsdl:definitions>.

The tesb:start-sam command will start the Derby database on localhost with default 1527 port, and installthe tesb-datasource-derby feature and tesb-sam-server feature. If you are using another Database (for exampleMySQL, H2, Oracle), please follow the instructions of DataSource and Service Activity Monitoring Serverinstallation/configuration in the Talend ESB Infrastructure Services Configuration Guide.

Service Activity Monitoring Server - Database re-creation activated by default

When a Service Activity Monitoring Server is installed in the Talend Runtime, by default, the database recreationis activated - see the org.talend.esb.sam.server.cfg configuration file. This shows errors in the console logfor each subsequent restart of the container ("can’t create table …"). To avoid this startup logging error, pleasechange the db.recreate property in org.talend.esb.sam.server.cfg to false (db.recreate=false) afteryou installed the Service Activity Monitoring Server.

Page 94: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Uninstalling previous features

90 Talend ESB Getting Started Guide

Configuration parameters for the Service Activity Monitoring in the TalendRuntime container

In a Talend Runtime container, if you want to configure some properties for Service Activity Monitoring access(for example service.url), please edit:

<TalendRuntimePath>/container/etc/org.talend.esb.sam.agent.cfg

4.1.2. Uninstalling previous features

1. Start the primary and alternate containers if they are not already running.

2. If you have already used the container to run previous examples, you should ensure that all the features fromthose previous examples have been uninstalled, including the feature tesb-rac-common which is implicitlyloaded as a dependency. Otherwise, the installation of the features for the locator example will fail. If in doubtabout whether previous features are still installed, enter the following commands in both containers:

features:uninstall tesb-rac-services

features:uninstall tesb-rac-common

If you installed Rent-a-Car Rental Client applicaton in this container, you should uninstall it too:

features:uninstall tesb-rac-app

These commands uninstall the remaining bundles from the basic example.

3. You can also remove the uninstalled features of the previous example from the container:

features:removeurl mvn:org.talend.esb.examples.rent-a-car/features/5.6.2/xml

This command removes the features of the basic scenario from the container.

4.1.3. Building the demo with Service ActivityMonitoring and Service Locator enabled

To build the demo, you will use Maven with the combined Service Activity Monitoring and Service Locatorprofile. So before building the demo, you have to make sure the Service Activity Monitoring and Service Locatorfeatures have been activated in your Talend Runtime container.

1. From a command line console, change the directory to <TalendRuntimePath>/examples/talend/tesb/rent-a-car.

The pom.xml file there is used by Maven to build the demo.

2. Run the Maven command on either Linux or Windows:

mvn install -Pslsam

Running this command will build the demo with the required functionalities and create OSGi bundles to bedeployed to the container.

These changes occur when you build the examples with the Service Activity Monitoring Agent and theService Locator enabled:

Page 95: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Installing the Rent-a-Car examples features

Talend ESB Getting Started Guide 91

• The jaxws:features of the Service Activity Monitoring Agent and also the Service Locator will be addedinto the Spring beans.xml file of the related client and service-endpoint, for example:

<import resource="classpath:META-INF/tesb/locator/beans-osgi.xml" /> <import resource="classpath:META-INF/tesb/agent-osgi.xml" /> ... <jaxws:features> <bean class="org.talend.esb.servicelocator.cxf.LocatorFeature"> <property name="selectionStrategy" value="randomSelectionStrategy"/> </bean> <ref bean="eventFeature"/> </jaxws:features>

• The MANIFEST.MF file of the related client and service-endpoint will be updated by adding the followingbundles in the Require-Bundle list: sam-common,sam-agent,locator.

4.1.4. Installing the Rent-a-Car examples features

4.1.4.1. Installing the examples in the primary container

1. Add the Rent-a-Car feature location into the primary Talend Runtime container (<TalendRuntimePath>/container/).

At the console prompt (karaf@trun>), type the following command:

features:addurl mvn:org.talend.esb.examples.rent-a-car/features-sl-sam/5.6.2/xml

Please update the version number "5.6.2" if it differs in your installation.

2. If previous examples have already been installed, run the following command:

features:refreshurl

3. Then enter the following commands:

features:install tesb-rac-services-sl-sam

features:install tesb-rac-app-sl-sam

4. Then, you can use the list command to check if everything installed properly.

For example:

[ 219] [Active ] [ ] [ ] [ 80] CRMService Common (5.6.2)[ 220] [Active ] [ ] [ ] [ 80] ReservationService Common (5.6.2)[ 221] [Active ] [ ] [ ] [ 80] CRMService Service (5.6.2)[ 222] [Active ] [ ] [Started] [ 80] CRMService Service Endpoint Locator and SAM (5.6.2)[ 223] [Active ] [ ] [ ] [ 80] ReservationService Service (5.6.2)[ 224] [Active ] [ ] [Started] [ 80] ReservationService Service Endpoint SL and SAM (5.6.2)[ 225] [Active ] [ ] [Started] [ 80] CRMService Client Locator and SAM (5.6.2)[ 226] [Active ] [ ] [Started] [ 80] ReservationService Client Locator and SAM (5.6.2)[ 227] [Active ] [Created ] [ ] [ 80] App Reservation (5.6.2)

Page 96: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the demo in one container to generate Service Activity Monitoring data

92 Talend ESB Getting Started Guide

4.1.4.2. Installing the examples in the alternate container

The alternate container is not used the first time you will run the demo, so you can shut it down after installing the featuresif you wish.

1. Start the alternate container.

2. In the alternate container console, type in the command:

features:addurl mvn:org.talend.esb.examples.rent-a-car/features-sl-sam/5.6.2/xml

3. If previous examples have already been installed, enter:

features:refreshurl

4. Then enter:

features:install tesb-rac-services-sl-sam

Install only these features, not tesb-rac-app-sl-sam.

5. Then, you can use the list command to check if everything installed properly. For example:

[ 219] [Active ] [ ] [ ] [ 80] CRMService Common (5.6.2)[ 220] [Active ] [ ] [ ] [ 80] ReservationService Common (5.6.2)[ 221] [Active ] [ ] [ ] [ 80] CRMService Service (5.6.2)[ 222] [Active ] [ ] [Started] [ 80] CRMService Service Endpoint Locator and SAM (5.6.2)[ 223] [Active ] [ ] [ ] [ 80] ReservationService Service (5.6.2)[ 224] [Active ] [ ] [Started] [ 80] ReservationService Service Endpoint SL and SAM (5.6.2)

4.1.5. Running the demo in one container to generateService Activity Monitoring data

This section describes how to deploy the demo services and client application in one container: the primary one(see Running the demo in one container to generate Service Activity Monitoring data) to look at the ServiceActivity Monitoring functionality. Therefore, the Service Locator is largely unused in this scenario, so you willnot need the alternate container.

1. Before really running the demo, stop the alternate-container if it is running, you will start it again for thenext run of the demo.

2. Run the client application as in the basic Rent-a-Car demo (see Running the demo for full details):

car:gui

3. In the Rental Client application user interface that displays, simply click Find.

This step is sufficent for the demo. You will then see output like this in the default container console:

###############################################getCRMInformation() invoked ... request data:org.talend.services.crm.types.LoginUserType@fc0795##############################################################################################getCRMInformation() invoked ... response data:org.talend.services.crm.types.CustomerDetailsType@560854

Page 97: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the demo in one container to generate Service Activity Monitoring data

Talend ESB Getting Started Guide 93

##############################################################################################getAvailableCars() invoked ... request data:org.talend.services.reservation.types.RESProfileType@a14297##############################################################################################getAvailableCars() invoked ... response data:org.talend.services.reservation.types.RESCarListType@11ad529###############################################

It shows the requests and responses for the CRMService and ReservationService.

4.1.5.1. Viewing the events in the Service Activity Monitoringinterface of the Talend Administration Center

After running the Rent-a-Car demo, users of the Enterprise and Platform products can monitor the activity of theservices through the Service Activity Monitoring GUI of the Talend Administration Center:

4.1.5.2. Viewing the events in the Service Activity Monitoringdatabase

After running the Rent-a-Car demo, users of Talend ESB Standard Edition and Talend Open Studio for ESBcan monitor the activity of the services through the EVENTS and EVENTS_CUSTOMINFO tables of the ServiceActivity Monitoring database using DbVisualizer (or any other database tool).

To connect to the Service Activity Monitoring database, use the following settings:

Database connection configuration (Default): DB Driver: org.apache.derby.jdbc.ClientDriver DB URL: jdbc:derby://localhost:1527/db DB username: test

Page 98: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the demo in two containers - simulating server failover with Service Locator

94 Talend ESB Getting Started Guide

DB password: test

The database connection must correspond to the settings defined in the <TalendRuntimePath>/etc/org.talend.esb.sam.server.cfg file, and the referenced data source configuration, which is Derby (ds-derby)by default, can be found in the <TalendRuntimePath>/etc/org.talend.esb.datasource.derby.cfg file.

Then, the data of the EVENTS and EVENTS_CUSTOMINFO tables can be browsed/monitored in DbVisualizer.For example, the data of the EVENTS table after running the Rent-a-Car demo with the Service Activity Monitoringfunctionality enabled looks like the following:

For more information about the schema definition of the tables, please look at the EVENTS Structure and theEVENTS_CUSTOMINFO Structure sections in the Talend ESB Infrastructure Services Configuration Guide.

4.1.6. Running the demo in two containers - simulatingserver failover with Service Locator

In this section, you will see how to re-run the demo but using two containers, while stopping one of the exampleservices. This will show the role of the Service Locator in case of service failover (see Running the demo intwo containers - simulating server failover with Service Locator), and show how the client re-connect to anotherservice, using this functionality.

Figure 4.1. Demonstrating server failover

Page 99: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Running the demo in two containers - simulating server failover with Service Locator

Talend ESB Getting Started Guide 95

There are a number of steps to this:

1. The app-reservation looks up the CRMService endpoint in the Service Locator.

2. It then connects directly to the CRMService in the primary container.

3. Here, you stop the CRMService.

4. The app-reservation automatically looks up the CRMService endpoint again in the Service Locator.

5. It then connects directly to the CRMService in the alternate-container.

4.1.6.1. Running the demo

1. Run the Rental Client application again by typing in the command car:gui in default container console andclicking Find in the application. While running the application, you will see the same request and responsesas before.

2. Do not close the GUI application, just click Back to get back to the previous booking step.

Simulate service failure

Now, simulate the service failure:

1. Start the alternate container.

2. In the default container, get the details of the CRMService bundle by typing the command list and note thenumber of the CRMService Service Endpoint bundle:

[ 222] [Active ] [ ] [ ] [ 80] CRMService Service Endpoint Locator and SAM (5.6.2)

(The number, here "222", will probably be different in your console.)

3. Stop it with the command stop 222 (using the bundle number you have found).

4. Then, click the Find button in the application GUI to activate the call to the CRMService.

Now, the ReservationService is working in the first container, and the CRMService in the second container.

In the first container console:

############################################### getAvailableCars() invoked ... request data: org.talend.services.reservation.types.RESProfileType@1d510be ############################################### ############################################### getAvailableCars() invoked ... response data: org.talend.services.reservation.types.RESCarListType@13e49a8 ###############################################

Afterwards, the Locator will switch to the CRMService in the second container; and in the alternate containerconsole, you will see the following:

Page 100: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing the events in the ESB Dashboards

96 Talend ESB Getting Started Guide

############################################### getCRMInformation() invoked ... request data: org.talend.services.crm.types.LoginUserType@1142653 ############################################### ############################################### getCRMInformation() invoked ... response data: org.talend.services.crm.types.CustomerDetailsType@1e03fce ###############################################

4.1.7. Accessing the events in the ESB Dashboards

For Enterprise and Platform users, once you deployed the Rent-a-Car services with the Service Activity Monitoringand Service Locator options enabled and requested them via the client application (the car:gui command in theprimary container), you will be able to see events in the Talend Administration Center ESB Dashboards.

In the Talend Administration Center Web application, click Monitoring > Logging in the menu tree view:

To access the event logs about the service endpoints, click the ESB Locator Endpoints dashboard:

Page 101: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing the events in the ESB Dashboards

Talend ESB Getting Started Guide 97

To access the event logs about the service activity, click the ESB SAM dashboard:

For more displays of the ESB Dashboards, see Accessing all ESB event logs in Talend Administration Center.

Page 102: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Uninstalling the demo features

98 Talend ESB Getting Started Guide

4.1.8. Uninstalling the demo features

In order to clean up both Talend Runtime containers for any subsequent running of examples, all features of thelocator example need to be uninstalled.

1. In the default container, enter the following commands at the console:

features:uninstall tesb-rac-services-sl-sam

features:uninstall tesb-rac-common-sl-sam

features:uninstall tesb-rac-app-sl-sam

2. In the alternate container, enter the following commands at the console:

features:uninstall tesb-rac-services-sl-sam

features:uninstall tesb-rac-common-sl-sam

3. Enter features:list | grep tesb-rac to ensure that all features have actually been uninstalled.

All the features shown should be in the "uninstalled" state.

4.2. Rent-a-Car demo using the SecurityToken Service to provide WS-Security basedSAML AuthenticationThis section describes building and running the Rent-a-Car demo with the Security Token Service feature enabledto provide WS-Security based SAML Authentication.

In order to enable WS-security for the Rent-a-Car example, the Security Token Service server has to be installedand deployed.

To be able to follow this demo example, you have to:

1. If needed, create an alternate container as described in Creating an alternate container for the Demos.

2. If needed, configure the logging to override the default logging configuration as described in Configuringlogging.

3. Start the primary container (and the alternate container, if necessary) with Infrastructure Services - seeStarting Talend Runtime.

4. Build the demo - see Building the demo with Security enabled.

4.2.1. Configuring logging

The STS functionality is enabled in the standard Rent-a-Car in <TalendRuntimePath>/examples/talend/tesb/rent-a-car/.

For the Rent-a-Car Security Token Service sample, automatic logging is enabled by default in the client and serviceconfiguration files.

Page 103: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building the demo with Security enabled

Talend ESB Getting Started Guide 99

To disable automatic logging in the sample, remove the following XML node from the beans.xml files in bothservices and clients of the Rent-a-Car Security Token Service sample:

<cxf:bus> <cxf:features> <cxf:logging /> </cxf:features></cxf:bus>

Log messages from clients and Security Token Service are stored in the alternate container:

./alternate-container/log/tesb.log

Log messages from services are stored in the same directory in the primary container.

4.2.2. Building the demo with Security enabled

To build the demo, you will use Maven with the Security Token Service profile.

1. To make sure the Security Token Service service is started, start the default Talend Runtime container, if youstopped it, and execute the following command in the console:

list

The following bundles should display on the list: Apache CXF STS Core and Talend :: ESB :: STS ::CONFIG which enable the STS functionality.

If you did not start the Security Token Service service yet, run it now via the tesb:start-all command,or if you want to only install the Security Token Service feature without all of the others (Security TokenService, Service Locator), run the tesb:start-sts command.

2. Enterprise and Platform users should make sure the security management system has been changed from theTIDM to JAAS (tesb:switch-sts-jaas). For more information, see Starting Talend Runtime.

3. Now to build the demo examples, from a command line console, run the following command from thedirectory <TalendRuntimePath>/examples/talend/tesb/rent-a-car/:

mvn install -Psts

4. Now, install the examples themselves. So, to add the Rent-a-Car feature location in the default containerconsole, type in:

features:addurl mvn:org.talend.esb.examples.rent-a-car/features-sts/5.6.2/xml

5. When the STS example has finished being installed, and the cursor returns, type in:

features:refreshurl

features:install tesb-rac-services-sts

Again, wait for the cursor to return.

6. Start the alternate container and in its console, type in:

features:addurl mvn:org.talend.esb.examples.rent-a-car/features-sts/5.6.2/xml

7. When the examples have been installed, and the cursor returns, type:

features:refreshurl

Page 104: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Uninstalling the demo features

100 Talend ESB Getting Started Guide

features:install tesb-rac-app-sts

Again, wait for the cursor to return.

Now, the STS sample is installed and ready to run.

8. Run the Rent-a-Car Rental Client application, for example, by running car:gui in the alternate container.For more information, see Building and deploying Data Services and Routes using Java.

4.2.3. Uninstalling the demo features

1. When you are finished running the demo, uninstall the Security Token Service features.

In the alternate container, type in:

features:uninstall tesb-rac-app-sts

features:uninstall tesb-rac-common-sts

2. In the primary container, type in:

features:uninstall tesb-rac-services-sts

features:uninstall tesb-rac-common-sts

4.3. Rent-a-Car demo using the ArtifactRepositoryThis section describes how to use the Artifact Repository to deploy the demo into the Talend Runtime. SeeFigure 1.6, “Talend Enterprise ESB operating principles” for an overview of how the Artifact Repository interactswith other components.

In a Talend ESB context, the Nexus Artifact Repository is used as a provisioning repositories managementsoftware. The Provisioning is used as a catalog in which all ESB artifacts (Routes, Services and Generic OSGifeatures) to be deployed and executed are stored. These ESB artifacts are designed by the developers in the Studioor any other Java IDE. By default, two repositories are embedded within this repository: one for development(Snapshots) and one for production (Releases). These repositories make artifacts available for deployment in theTalend Runtime.

Page 105: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Downloading and installing Nexus Artifact Repository

Talend ESB Getting Started Guide 101

In this section, you will see how to manually publish the Rent-a-Car demo in an Artifact Repository, and howto deploy its services from that Artifact Repository to the Talend Runtime container. Here are the major stepsof the use case:

• Download and install an Artifact Repository - see Downloading and installing Nexus Artifact Repository).

• Publish the Rent-a-Car demo features in the Artifact Repository - see Publishing the demo to the ArtifactRepository).

• Deploy the Rent-a-Car demo features from the Artifact Repository to the Talend Runtime, manually forcommunity products like Talend ESB Standard Edition or Talend Open Studio for ESB - see Deploying thedemo to Talend ESB Standard Edition with Nexus Artifact Repository

• Deploy the Rent-a-Car demo features from the Artifact Repository to the Talend Runtime via the TalendAdministration Center for Talend Enterprise or Platform products - see Deploying the demo from ArtifactRepository to Talend Runtime with Talend Administration Center.

4.3.1. Downloading and installing Nexus ArtifactRepository

So for this use case, you will use Sonatype Nexus, which is Talend's recommended Artifact Repository. Nexusacts as a sort of shared server of Maven artifacts repositories.

If you are using Talend ESB Standard Edition or Talend Open Studio for ESB, download the Nexus OpenSource or Nexus Pro distributions available on the Nexus Website: http://www.sonatype.org/nexus and follow theinstallation instructions in Nexus's Website.

If you are using the Talend Enterprise or Platform products, you have already installed the Talend ArtifactRepository when installing the Talend Administration Center, as described in Starting the Talend AdministrationCenter.

To install it, simply unzip the package.

To start it, browse to its directory and run:

• ./bin/nexus console (Linux)

• .\bin\nexus.bat console (Windows)

Nexus is now running on http://localhost:8081/nexus/index.html with login: admin and password:admin123, by default.

4.3.2. Publishing the demo to the Artifact Repository

The following procedure can be executed either from the Talend ESB Standard Edition and Talend Open Studiofor ESB products or from the Talend Enterprise or Platform products, depending on the version of the productyou have. It shows you how to publish the demo into a Nexus Artifact Repository with the Maven project filesprovided to you with the Talend Runtime, to later on deploy the demo from the Artifact Repository to the TalendRuntime container.

1. Make sure Sonatype Nexus or Talend Nexus Artifact Repository (for Enterprise or Platform users) is installedand running - as described in Downloading and installing Nexus Artifact Repository.

In case you installed it via the Talend Installer (for Enterprise or Platform users), you will find it as the TalendArtifact Service in your environment.

Page 106: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Publishing the demo to the Artifact Repository

102 Talend ESB Getting Started Guide

2. Add the following section in the Maven configuration file <TalendRuntimePath>/examples/talend/tesb/rent-a-car/settings.xml and in your $user.dir/.m2/settings.xml file:

<server> <id>nexus</id> <username>admin</username> <password>admin123</password></server>

3. In the Maven project file <TalendRuntimePath>/examples/talend/tesb/rent-a-car/pom.xml, changethe <distributionManagement> section to:

<distributionManagement>

<!-- use the following if you're not using a snapshot version. --> <repository> <id>nexus</id> <name>RepositoryProxy</name> <url>http://localhost:8081/nexus/content/repositories/releases</url> </repository>

<!-- use the following if you ARE using a snapshot version. --> <snapshotRepository> <id>nexus</id> <name>RepositoryProxy</name> <url>http://localhost:8081/nexus/content/repositories/snapshots</url> </snapshotRepository></distributionManagement>

http://localhost:8081/nexus/content/repositories/releases is the right URL to use when Nexusis installed as standalone or when using Talend Nexus Artifact Repository. However, if Nexus was installedas a Web Application in Tomcat (WAR File deployment), the URL is http://localhost:8080/nexus-webapp/content/repositories/releases.

4. In the file <TalendRuntimePath>/container/etc/org.ops4j.pax.url.mvn, check the URL of theNexus repository in the parameter org.ops4j.pax.url.mvn.repositories and edit it if necessary.

org.ops4j.pax.url.mvn.repositories= \.....http://localhost:8080/nexus-webapp/content/repositories/releases@id=tesb.release, \http://localhost:8080/nexus-webapp/content/repositories/snapshots@snapshots@id=tesb.snapshot, \

http://localhost:8081/nexus/content/repositories/releases@id=tesb.release is the rightURL to use when Nexus is installed as standalone or when using Talend Nexus Artifact Repository. However,if Nexus was installed as a Web Application in Tomcat (WAR File deployment), the URL is http://localhost:8080/nexus-webapp/content/repositories/releases@id=tesb.release.

5. From a command line console, change the directory to <TalendRuntimePath>/examples/talend/tesb/rent-a-car/ and run the following command to deploy the Rent-a-Car example features in the ArtifactRepository:

mvn deploy

6. Go to http://localhost:8081/nexus/content/repositories/releases, the Rent-a-Car sample:org.talend.esb.examples.rent-a-car is successfully deployed.

Now that the Rent-a-Car demo features have been published to the Artifact Repository, you can deploy them inyour Talend Runtime container. For more information on how to do this:

• For Talend ESB Standard Edition and Talend Open Studio for ESB users, see Deploying the demo to TalendESB Standard Edition with Nexus Artifact Repository.

• For Talend Enterprise or Platform users, see Deploying the demo from Artifact Repository to Talend Runtimewith Talend Administration Center.

Page 107: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the demo to Talend ESB Standard Edition with Nexus Artifact Repository

Talend ESB Getting Started Guide 103

4.3.3. Deploying the demo to Talend ESB StandardEdition with Nexus Artifact Repository

This section is addressed to the users of the Talend ESB Standard Edition and Talend Open Studio for ESB. Ifyou are a user of the Enterprise or Platform products, please go to Deploying the demo from Artifact Repositoryto Talend Runtime with Talend Administration Center. It describes how to deploy the Rent-a-Car demo featuresfrom the Artifact Repository to your Talend Runtime container.

1. Make sure that the Rent-a-Car demo features have been published to the Artifact Repository - as describedin Publishing the demo to the Artifact Repository.

To check that they have been published, you can go to http://localhost:8081/nexus/content/repositories/release, where the Rent-a-Car sample org.talend.esb.examples.rent-a-car should havesuccessfully been deployed.

2. Start the container - see Starting Talend Runtime.

3. Install the Rent-a-Car features in the Talend Runtime container with these commands:

features:addurl mvn:org.talend.esb.examples.rent-a-car/features/5.6.2/xml

features:refreshurl

features:install tesb-rac-services

features:install tesb-rac-app

4. Run the demo with this command:

car:gui

4.3.4. Deploying the demo from Artifact Repository toTalend Runtime with Talend Administration Center

This section is addressed to the users of the Enterprise or Platform products. If you are a user of the Talend ESBStandard Edition and Talend Open Studio for ESB, please go to Deploying the demo to Talend ESB StandardEdition with Nexus Artifact Repository. It describes how to deploy the Rent-a-Car demo features from the ArtifactRepository to your Talend Runtime container via the Talend Administration Center Web application.

1. Make sure the Talend Runtime, Talend Administration Center, and Nexus Artifact Repository are running- as described in Starting the software.

2. Make sure that the Rent-a-Car demo features have been published to the Artifact Repository - as describedin Publishing the demo to the Artifact Repository.

To check that they have been published, you can go to http://localhost:8081/nexus/

content/repositories/release, where the Rent-a-Car sample org.talend.esb.examples.rent-a-car hassuccessfully been deployed.

3. From the Talend Administration Center, under Conductor, click ESB Conductor to create a new deploymenttask.

4. Click the Add button on the top and fill in the Edition form that displays to the right:

Page 108: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the demo from Artifact Repository to Talend Runtime with Talend Administration Center

104 Talend ESB Getting Started Guide

5. In the Label field of the Metadata area, name the service rent-a-car, and in Description, put demo, forexample.

6. In the Feature area, click Select Feature to open the [Select Feature from Nexus repository] wizard thatwill help you fill in the following fields of this area:

Page 109: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Deploying the demo from Artifact Repository to Talend Runtime with Talend Administration Center

Talend ESB Getting Started Guide 105

7. In the Repository list, select releases, and browse through org > talend > esb > examples > rent-a-car >features > 5.6.2, select the features-5.6.2.xml feature, and click OK. The fields of the Features area willbe filled in automatically.

In the Name list, select the tesb-rac-services option, and in the Type list, select Service.

8. In the Server list of the Runtime Config area, select the Talend Runtime Container.

Click Save to create the deployment task.

9. The rent-a-car deployment task appears in the list:

Page 110: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Rent-a-Car demo using XKMS

106 Talend ESB Getting Started Guide

Click Deploy and the tesb-rac-services feature will be deployed into the Talend Runtime Container andwill be started automatically.

The Last Action column value changes from CREATED to DEPLOYED.

The Rent-a-Car services are now deployed and automatically started in the Talend Runtime container and cannow be used. If you type list at the console prompt of the container, you will see that the services are active:

[ 349] [Active ] [ ] [ ] [ 80] CRMService Common (5.6.2)[ 350] [Active ] [ ] [ ] [ 80] ReservationService Common (5.6.2)[ 351] [Active ] [ ] [ ] [ 80] CRMService Service (5.6.2)[ 352] [Active ] [ ] [Started] [ 80] CRMService Service Endpoint JMX (5.6.2)[ 353] [Active ] [ ] [ ] [ 80] ReservationService Service (5.6.2)[ 354] [Active ] [ ] [Started] [ 80] ReservationService Service Endpoint JMX (5.6.2)

To use those services via the Rent-a-Car Rental Client application, you should deploy its corresponding serviceinto the Talend Runtime container as well. To do so, follow the same procedure described above, but select thetesb-rac-app feature in the Name list of the Features area.

Once the Rental Client application service deployed in the Talend Runtime container, run its interface via thecar:gui command and use the Rent-a-Car services with it.

For another use case of deployment via the Talend Administration Center, see Publishing and deployment fromthe Talend Administration Center. In this use case, both publishing to the Artifact Repository and deployment toTalend Runtime container are handled with the Talend Administration Center, as the development of the servicewas made in the Talend Studio.

For more details on the ESB Conductor, see the Talend Administration Center User Guide.

4.4. Rent-a-Car demo using XKMSThis section describes how to configure the Rent-a-Car example which gets public certificates from the XKMSservice to encrypt/sign messages.

The XKMS feature is only available with Talend's Enterprise and Platform products. So, if you are a user of TalendESB Standard Edition and Talend Open Studio for ESB, you will not be able to execute this demo.

To be able to follow this demo example, you have to:

1. Start the container with Infrastructure Services - see Starting Talend Runtime.

2. Configure the XKMS service - see Configuring the XKMS service for the demo.

3. Build and run the demo - see Building the Rent-a-Car demo example.

4.4.1. Configuring the XKMS service for the demo

Once the Talend Runtime container and XKMS service started, you need to adapt the default configuration tothe demo:

1. To make sure the XKMS service is started, start the default Talend Runtime container, if you stopped it, andexecute the following command in the console:

Page 111: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Building the Rent-a-Car demo example

Talend ESB Getting Started Guide 107

list

The following bundles which enable the XKMS functionality should display on the list:

[ 233] [Active ] [ ] [ ] [ 80] Apache CXF XKMS Common (2.7.11)[ 234] [Active ] [Created ] [ ] [ 80] Apache CXF XKMS Client (2.7.11)[ 343] [Active ] [ ] [ ] [ 80] Apache CXF XKMS Service (2.7.11)[ 344] [Active ] [ ] [ ] [ 80] Apache CXF XKMS X509 Handlers (2.7.11)[ 345] [Active ] [Created ] [ ] [ 80] Apache CXF XKMS OSGi deployment (2.7.11)

If you did not start the XKMS service yet, run it now via the tesb:start-all command, or if you wantto only install the XKMS feature without all of the others (Security Token Service, Security Token Service,Service Locator), run the tesb:start-xkms command.

2. The XKMS service supports both LDAP and File as backend repository. In a testing or demo environment,configure the XKMS service to use File repository (more simple to use).

Edit the container/etc/org.apache.cxf.xkms.cfg configuration file.

3. Make sure the Certificate repository parameter is set as follows:

xkms.certificate.repo=file

4. Make sure the Filesystem backend parameter is set as follows:

xkms.file.storageDir=${karaf.home}/esbrepo/xkms/certificates

The public certificates (*.cer) used in this example have been preinstalled into the default ${karaf.home}/esbrepo/xkms/certificates/trusted_cas XKMS repository of the Talend Runtime container.

4.4.2. Building the Rent-a-Car demo example

To build this example, you need to build the XKMS Rent-a-Car example, which is available on a specific XKMSfolder of the runtime.

1. Now to build the demo examples, from a command line console, change the directory to:

<TalendRuntimePath>/examples/talend/xkms/rent-a-car

And run the following command:

mvn install

2. Now, install the examples themselves. In the Talend Runtime container console, execute the followingcommands:

features:addurl mvn:org.talend.esb.ee.examples.rent-a-car/features/5.6.2/xml

features:install tesb-rac-services-xkms

features:install tesb-rac-app-xkms

3. Then, you can use the list command to check if everything installed properly:

[ 373] [Active ] [ ] [ ] [ 80] CRMService Common (5.6.2)[ 374] [Active ] [ ] [ ] [ 80] ReservationService Common (5.6.2)

Page 112: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing all ESB event logs in Talend Administration Center

108 Talend ESB Getting Started Guide

[ 375] [Active ] [ ] [ ] [ 80] CRMService Service (5.6.2)[ 376] [Active ] [ ] [Started] [ 80] CRMService Service Endpoint XKMS (5.6.2)[ 377] [Active ] [ ] [ ] [ 80] ReservationService Service (5.6.2)[ 378] [Active ] [ ] [Started] [ 80] ReservationService Service Endpoint XKMS (5.6.2)[ 379] [Active ] [ ] [Started] [ 80] CRMService Client XKMS (5.6.2)[ 380] [Active ] [ ] [Started] [ 80] ReservationService Client XKMS (5.6.2)[ 381] [Active ] [Created ] [ ] [ 80] App Reservation (5.6.2)

4. To use the demo, you can use the Rental Client interface. To open it, execute the following command at theTalend Runtime container console prompt:

car:gui

4.5. Accessing all ESB event logs in TalendAdministration CenterIf you are an Enterprise or Platform user, you can access to the ESB Dashboards in Talend Administration Center.Those dashboards gathers logs related to ESB events, to locator endpoints and service availability, and to theService Activity Monitoring. This feature is not available in the Talend ESB Standard Edition and the TalendOpen Studio for ESB.

This section describes how to use the Talend Administration Center ESB Dashboards.

In the Talend Administration Center Web application, click Monitoring > Logging in the menu tree view:

The dashboard above is the default one, it displays graphically the events and classify them according to thelog threshold that you have defined in the TAC Configuration page. For more information, see the TalendAdministration Center User Guide.

To access the event logs about the service endpoints, click the ESB Locator Endpoints dashboard:

Page 113: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing all ESB event logs in Talend Administration Center

Talend ESB Getting Started Guide 109

The above dashboard displays all the endpoints of the services deployed in the Talend ESBContainer and their availability. For example here, four endpoints are listed: one for the EmployeeREST service use case ({http://www.talend.org/rest/}EmployeeService), one for the SayHelloservice use case ({http://www.talend.org/service/}SayHelloService), and two for the Rent-a-Car use case ({http://services.talend.org/CRMService}CRMServiceProvider and {http://

services.talend.org/ReservationService}ReservationServiceProvider). The four of them areavailable and active.

To access the event logs about the service activity, click the ESB SAM dashboard:

Page 114: Talend ESB - Getting Started Guidedownload-mirror1.talend.com/esb/user-guide... · Talend ESB Features 2 Talend ESB Getting Started Guide 1.1. Talend ESB Features Talend ESB is a

Accessing all ESB event logs in Talend Administration Center

110 Talend ESB Getting Started Guide

The above dashboard displays all the service activity. The four services used in the use cases are used.As you can see, the services created in the use cases of this guide have been requested, and to mostof these requests corresponds a response. In addition, the most requested services are listed. Here, thetwo Rent-a-Car services ({http://services.talend.org/CRMService}CRMServiceProvider and {http://services.talend.org/ReservationService}ReservationServiceProvider) are the top requested ones.