Download as pdf or txt
Download as pdf or txt
You are on page 1of 203

ESB Basics 6.

0
All Presentations

©2015 Talend Inc.

1
All Presentations

Introduction
• Talend Overview
• ESB Introduction
Lessons (and Detours)
1. Developing Routes
- Technical Detour – Apache Camel
2. Message Processing Routes
- Technical Detour – Apache ActiveMQ
3. Connecting Routes
4. Developing Routes with DI Jobs
5. Developing SOAP Web Services
6. Developing REST Web Services

©2015 Talend Inc. 2


Talend Overview
Products & Courses

©2015 Talend Inc.

©2015 Talend Inc. 1


Agenda

• Talend Products
• Unified Platform highlights
• Talend Modules
• Talend Course View
• Curriculum logical progress

©2015 Talend Inc. 2


Talend Product Families

• Data Integration (DI) • Application Integration (AI or ESB)


- Talend Open Studio for DI - Talend Open Studio for ESB
- Talend Open Studio for DQ - Talend Enterprise Service Bus
- Talend Data Integration - Talend Data Services Platform
- Talend Data Management Platform
• Master Data Management (MDM)
- Talend Open Studio for MDM
• Big Data (BD) - Talend MDM Platform
- Talend Open Studio for Big Data
- Talend Big Data
• Talend Data Fabric
- Talend Big Data Platform
- Talend Real-Time Big Data Platform
(incl. Spark Streaming)
• Talend Cloud Integration

©2015 Talend Inc. 3


Unified Platform

©2015 Talend Inc. 4


Talend Unified Platform - Workflow

©2015 Talend Inc. 5


Talend Modules

BIG DATA

Hadoop based data integration

MASTER DATA MANAGEMENT


Unified data enables a single version of the truth
TALEND DATA MAPPER
Hierarchical data mapper for complex structures
Training
ENTERPRISE SERVICE BUS Modules
Real-time data, application and service integration

DATA QUALITY
Data profiling, standardization, enrichment

DATA INTEGRATION
Access and delivery of data

Unified Platform - Foundation for all Product Families

©2015 Talend Inc. 6


Talend Modules
Unified Platform
BIG DATA

Hadoop based data integration

MASTER DATA MANAGEMENT


Unified data enables a single version of the truth
TALEND DATA MAPPER
Hierarchical data mapper for complex structures
Platform Foundation
ENTERPRISE SERVICE BUS
Real-time data, application and service integration 1. Eclipse based UI

DATA QUALITY 2. Consolidated metadata &


project info
Data profiling, standardization, enrichment
3. Web based deployment &
DATA INTEGRATION
scheduling
Access and delivery of data
4. Same container for batch
UNIFIED PLATFORM processing, message
2.Repository 4.Execution routing & services

1.Studio 3.Deployment 5.Monitoring


5. Single web-based
monitoring console

©2015 Talend Inc. 7


Talend Modules
Data Integration (DI)
BIG DATA

Hadoop based data integration

MASTER DATA MANAGEMENT


Unified data enables a single version of the truth
TALEND DATA MAPPER Common Use Cases
Hierarchical data mapper for complex structures
• Extract Transform Load
ENTERPRISE SERVICE BUS
• Extract Load Transform
Real-time data, application and service integration
• Data migration
DATA QUALITY
Data profiling, standardization, enrichment • Slow changing dimension

DATA INTEGRATION • Data analytics

Data Version Business Change Job Parallel High


Access ETL / ELT Control Rules Data Capture Scheduler Processing Availability

Unified Platform - Foundation for all Product Families

©2015 Talend Inc. 8


Talend Modules
Data Quality (DQ)
BIG DATA

Hadoop based data integration

MASTER DATA MANAGEMENT


Unified data enables a single version of the truth
TALEND DATA MAPPER
Hierarchical data mapper for complex structures Common Use Cases

ENTERPRISE SERVICE BUS • Input validation for legacy


(or poorly written)
Real-time data, application and service integration applications

DATA QUALITY • Identify duplicate records


Parsing, Drill-down DQ Portal, Data Report Data Custom
Data Profiling
Matching to Values Monitoring Stewardship Design Validation Analysis • Database statistics

• Pattern matching (and


DATA INTEGRATION deviations)
Access and delivery of data
• Verify primary/foreign key
relationships
Unified Platform - Foundation for all Product Families

©2015 Talend Inc. 9


Talend Modules
Enterprise Service Bus (ESB)
BIG DATA

Hadoop based data integration

MASTER DATA MANAGEMENT


Unified data enables a single version of the truth
TALEND DATA MAPPER
Hierarchical data mapper for complex structures
Common Use Cases
ENTERPRISE SERVICE BUS
• Middleware for legacy
Service Service Message EI Security Service Identity applications
Creation Mediation Routing Patterns Services XKMS Governance Management

• Real-time transactions
DATA QUALITY
Data profiling, standardization, enrichment

DATA INTEGRATION
Access and delivery of data

Unified Platform - Foundation for all Product Families

©2015 Talend Inc. 10


Talend Modules
Talend Data Mapper (TDM)
BIG DATA

Hadoop based data integration

MASTER DATA MANAGEMENT


Unified data enables a single version of the truth

TALEND DATA MAPPER


Common Use Cases
Implemented Complex Complex
Standard Structures Maps Refactoring Supports DI Supports ESB • Hirarchical Structures
• Implemented Standards
• SAP
ENTERPRISE SERVICE BUS • TDM Maps used in DI and
ESB
Real-time data, application and service integration

DATA QUALITY
Data profiling, standardization, enrichment

DATA INTEGRATION
Access and delivery of data

Unified Platform - Foundation for all Product Families

©2015 Talend Inc. 11


Talend Modules
Master Data Management (MDM)
BIG DATA

Hadoop based data integration

MASTER DATA MANAGEMENT


Common Use Cases
Data Modeling Event Integration Data Stewardship Survivorship BPM Workflow Data Services • Golden Record or single
version of the truth for
Enterprise data
TALEND DATA MAPPER
Hierarchical data mapper for complex structures • 360 degree view of the
customer
ENTERPRISE SERVICE BUS
Real-time data, application and service integration

DATA QUALITY
Data profiling, standardization, enrichment

DATA INTEGRATION
Access and delivery of data

Unified Platform - Foundation for all Product Families

©2015 Talend Inc. 12


Talend Modules
Big Data (BD)
BIG DATA
Common Use Cases
MapReduce Pig, Sqoop, Hadoop Job Machine NoSQL
Hadoop 2.0 Spark ETL/ELT Yarn Hive Scheduler learning Support • Data Warehouse
optimization

MASTER DATA MANAGEMENT • Clickstream analysis

Unified data enables a single version of the truth • Sentiment analysis


TALEND DATA MAPPER
• Fraud detection
Hierarchical data mapper for complex structures
• Recommendation engine
ENTERPRISE SERVICE BUS
Real-time data, application and service integration

DATA QUALITY
Data profiling, standardization, enrichment

DATA INTEGRATION
Access and delivery of data

Unified Platform - Foundation for all Product Families

©2015 Talend Inc. 13


Talend Modules
Training course view

BIG DATA Highlights


Basics / Advanced
• On-Demand Training (ODT)
MASTER DATA MANAGEMENT
• Instructor-Led Training (ILT)¹
Basics / Advanced – Integration & Workflow / Advanced – Matching (option)
• Virtual Machines (VMs) for
TALEND DATA MAPPER
lab exercises
Basics / Advanced
• Learning Management
ENTERPRISE SERVICE BUS
System (LMS)
Basics / Advanced • Access for 1 year
• Downloadable
DATA QUALITY materials
Basics / Advanced

DATA INTEGRATION
Basics / Advanced / Administration

http://www.talend.com/services/training ¹ MDM is currently ILT only

©2015 Talend Inc. 14


Mandatory
Training Curriculum Progress Recommended

MDM ESB TDM BD DI

MDM Advanced –
Integration &
Workflow

MDM Basics

DQ Advanced ESB Advanced TDM Advanced BD Advanced

DI DI Component
DQ Basics ESB Basics TDM Basics BD Basics
Administration Development

DI Advanced

DI Basics

©2015 Talend Inc. 15


Solutions for data challenges… delivered

©2015 Talend Inc.

©2015 Talend Inc. 16


Enterprise Service Bus
Introduction

©2015 Talend Inc.

1
What is an ESB?
Industry View

...is a software architecture odel used for desig i g a d


implementing the interaction and communication between
software applications within a service-oriented architecture
“OA .
Source: Wikipedia

2
What is ESB?
Practical View

• Infrastructure software that provides several core features &


benefits
- Replaces point-to-point interface with a managed common interface
- Real time message processing
- Routing
- Mediation
- Enrichment
- Solutions for Enterprise Integration Patterns (EIPs)
- Security
- Service Discovery
- Web Services

3
When to use ESB? When to use DI?

• It depends! However, the following are often determining factors:


- Batch vs. Real-time
- High volume vs. lower volume
- Unknown format
- Data transformation complexities

• Generally speaking
- ESB for real-time messaging
- DI (ETL/ELT) for high volume batch jobs
- ESB if format is unknown
- DI for highly complex data transformations

4
ESB Features

• Location transparency
• Transport protocol conversion
• Message transformation
• Message routing (static and dynamic)
• Security
• Monitoring and management

5
Legacy vs. ESB
Point-to-point vs. Enterprise Service Bus
HR
In the Cloud

Shipping

Enterprise Service Bus

ERP CRM
ERP CRM HR Shipping
On Premises

• Only realistic for small numbers of applications • Applications connected using service
• Integrations is costly to maintain and more interfaces through a common bus
fragile and brittle over time • Resulting architecture becomes much
more agile and flexible

6
ESB High Level View

NEW
COBOL ERP
APPLICATION

ENTERPRISE SERVICE BUS


• Messaging • Routing
• Service Location/Registry • Security
• Monitoring • Governance…

CALL CENTER CRM

7
Talend ESB Studio

- Quickly and easily create data services and


complex message routes without coding

- Leverage existing skill sets with Eclipse-


based UI

- Drag-and-drop message routes using


Enterprise Integration Patterns (EIPs)

- Collaborate on projects and artifacts


through Repository

- Easily monitor and analyze application and


data service events

- 450+ components
 Business Applications: SAP, Salesforce, Sugar CRM, Sage X3, etc.
 Databases: Oracle, MySQL, DB/2, LDAP, Teradata, AS/400, etc.
 Content & Mapping: P ositional, delimited, Excel, EDIFACT, XML, etc.

8
Course Objectives

After completing this course, you will be able to:


• Create a Talend project
• Create and run Talend Routes that:
• use Enterprise Integration Patterns (EIPs)
• add custom Java code
• communicate via a Message Queue
• Call DI Jobs
• Create and use context variables
• Create and use ESB Resources
• Create Web Services using SOAP and REST protocols

9
Additional Information

• Documentation
- http://help.talend.com
- Talend ESB Getting Started Guide
• Webinar - Talend Open Studio for ESB for Dummies
- https://www.talend.com/resources/webinars/talend-open-studio-for-
esb-for-dummiesForum

10
© Talend Inc. 2015
11
Navigation
LMS Navigation guidelines

©2015 Talend Inc.

1
A few general thoughts before you get started

• LMS does not enforce sequential navigation/completion of each


section in a Lesson, Lesson in a course, etc.
- You can navigate as you wish
- We recommend a top-down progression however (and mark Completed
as you go)
• Navigation Tips are built-into the Presentation and suggest when to
perform Lab Exercises
- These are suggestions, not enforced
- Some may choose to finish entire Presentation, then all Labs
- Others may switch back and forth as directed
• To obtain a Course Completion Certificate does require finishing the
end of course Survey

2
Primary Display
Previous Section (in this course) Next Section

Drop-down
• Navigate to any part of
any lesson
• Example on next slide

Scroll-bar

Previous page (in this presentation) Next page

3
Drop-down Navigation

Lesson Headings

Sections within a Lesson


• Presentation slides
• Step-by-step Lab instructions
Recommended
• Navigate in a top-down fashion
• Mark each Completed as you go
(marked by a √ in the drop-down)

4
Continue Button

Two possible buttons at the bottom of the current section display:

• Current section has not been completed


• Click this to mark as completed and continue
to the next section

• Current section has been completed


• Click this to continue to the next section
(or use other navigation options)

5
Suggested Navigation (between Presentation & Labs)
Suggested Navigation Tip
• Gold footer
• Familiar compass icon
• Includes brief instructions

Why?
• Some Lessons have more than
one lab exercise
• Tip allows for flexibility
• Follow suggestion or…
• … Complete entire
Presentation then all Labs
• … Switch back and forth
between Presentation & Labs

Example Tips

6
Context Switching (Presentation & Labs)
• Why? Some Lessons have more than one lab
1. Step through the Presentation until directed to the Lab exercises
2. Open the Lab exercise
• Right-click > Open Frame in new Tab (varies slightly by browser)
• Leave this second Tab open with the Lab exercises
• Complete one or more labs (as originally suggested in the Navigation Tip)
3. Return to the Presentation you were on in the original tab
4. You now have a Tab for the Presentation and another Tab for the Lab exercises for
the current Lesson
• Free to advance by page or scroll through, mark as completed (√), etc.
• Single click between Presentation and Labs as desired (or directed)

Presentation Lab exercises

7
© Talend Inc. 2015
8
Developing Routes

©2015 Talend Inc.

11
Lesson Overview

• Talend Studio
- Basic preparation for future (more in-depth) Lab exercises
• ESB Routes
- Develop two basic routes
- Preparation for more involved Routes and Services

22
Lesson Objectives

After completing this lesson, you will be able to:


• Create a Talend ESB project and use Talend Studio features
- Create Context Groups for context specific variables
- Switch between Mediation and Integration perspective
- Invoke context sensitive Help
• Create Talend ESB Routes that
- Read data files, transform the data, route and then output the data
• Run and Kill a Talend Route

33
Lesson Labs

• Creating a Project (Studio)


• Send a File (using cFile)
• Send a File (using cMessagingEndpoint)

44
Studio and ESB Basics

©2015 Talend Inc.

55
Talend Studio

• Eclipse-based tooling environment for modeling, configuring, and


deploying integration solutions
• Allows creation of integration solutions for deployment to Talend ESB
• Provides the graphical foundation for all Talend data management
and application integration solutions
• Provides consistency across application and data integration projects
so that resources can be shared
• Not required to access ESB functionality

66
Talend Studio Mediation Perspective

77
Terminology (1 of 2)

• Job
- Components connected to setup and run dataflow management processes
• Data Service Job
- Components connected to combine data integration processes with web
services (e.g. SOAP and/or REST)
• Route
- Components connected to run routing and mediation rules,
- Define how messages are moved from one service or endpoint to another
- Based on the Apache Camel framework
• Service
- WSDL objects that set up and implement Web services (SOAP)
- Associated with data service Jobs as service provider and consumer
- REST web services also supported (Representational State Transfer)

88
Terminology (2 of 2)

• Context Environment – T pi al e a ples: De , Test, Produ tio , …


• Context Variable – Enables injection of values from outside the
Route, based on the Context Environment
• Context Group – Group of related Context Variables
• Enterprise Integration Patterns (EIPs)

99
Lab Overview & Goal
Creating a Project

• Goals
- Start Talend
- Create a Project
- Switch Projects
- Switch Perspectives

Perform the Creating a Project Lab exercise before continuing with slides

10
10
Routes

©2015 Talend Inc.

11
11
Studio Components
Integration and Mediation Perspectives

• Talend components
- Begi ith a t
- tESBConsumer
- tRESTResponse, …

• Camel components
- Begi ith a
- cLog
- cFile All three used in upcoming Lab exercises
in this Lesson
- cFileDestination
- cMessagingEndpoint,… Used in later Lessons
- http://camel.apache.org/components.html

12
12
Camel Components in Talend

• To consume sources and produce destinations


- cFile, cDirect, cDirectVM, cCXF, cFTP, cJMS
• For any other Camel component use
- cMessagingEndPoint

13
13
cFile

• Purpose
- Provide read/write access to the local file system
- Used by other Camel components
• Common Configuration
- Path – Path to file(s) that will be read/written
- Noop – Keep files in the original folder (or not)
- Autocreate – Create directories in <Path> that do ’t e ist
- Encoding – “et file e odi g UTF8, I“O, …
- fileName – File to be processed
• la k – Process all files in <Path>
• Otherwise only process individual files
• Supports Simple Expression language syntax
• http://camel.apache.org/file2.html
14
14
cMessagingEndpoint

• Purpose
- Send or receive messages
- Must o figure to se d or re ei e si gle e dpoi t a ’t do oth
• Common Configuration
- URI – URI of the message to send or receive
• file:/FolderNa e?optio = alue&optio = alue
- Advanced Setting > Dependencies > Camel Component
• jetty:http://localhost:8556/myapp/myservice Jett URI e a ple
• Supports Camel core and many others A…) ampq, o , ftp, … zookeeper)
- Supported URIs
• https://camel.apache.org/uris.html

15
15
Lab Overview & Goal
Send a File (using cFile)

• Goal
- Develop a Route to copy a file from one directory to another
• Create
- Context Group
- Route
• Configure
- Key component: cFile (Messaging family)
• Provide access to file systems
• Saves output to disk
• Run and verify output

Continue to the next slide before performing the Send File Labs.

16
16
Lab Overview & Goal
Send a File (using cMessagingEndpoint)

• Goal
- De elop a Route to op a file fro o e dire tor to a other…
- …usi g a ore ge eri o po e t
• Create
- Route
• Configure
- Key component: cMessagingEndpoint (Messaging family)
• Allows applications to communicate by sending or receiving messages
• Lab copies a file (but many formats are supported))
– http://camel.apache.org/components.html
– See ESB Mediation Component Reference Guide for commonly used components
• Run and verify output
Perform both Send a File Lab exercises before continuing with the slide Presentation

17
17
Lesson Summary / Q&A

• Talend
- Start and create a new local Project
- Create Context Groups (and Context Variables) for use in ESB Routes
- Talend ESB Routes are based upon Apache Camel
• ESB Routes – Rule that specifies:
- Which sources to accept messages from
- How to process messages
- Where to send messages to (destination endpoints)
• Routes to send (copy) files
- Using cFile (specific Camel component)
- Using cMessagingEndpoint (generic Camel component)

18
18
Additional Information

• Talend Documentation
- Product online help
- http://help.talend.com
- Talend ESB Getting Started Guide
• Apache Camel
- http://camel.apache.org
- Apache Camel Technical Detour

Note: Apache Camel has many different books, websites, etc.

19
19
© Talend Inc. 2015
20
20
Apache Camel
Technical Detour

©2015 Talend Inc.

11
Apache Camel

• Apache Software Foundation


- Open source, community led
- http://apache.org
• Project of the Apache Software Foundation
- http://camel.apache.org
• Messaging technology that joins start/endpoints
- Enables messaging from differe t sources… to different destinations
• Makes integration easier
- Implements common Enterprise Integration Patterns (EIPs)
- Connects to many transports and APIs
- Easy to use Domain Specific Languages (DSLs) to bring EIPs and
transports together
• Extensive component library
22
Apache Ca el is…

• A routing engine
• A mediation engine
• An integration framework
• Highly portable
• Java object-based

33
Domain-Specific Language
Routing defined in DSL

• Java
- Fluent API that allows code completion by your IDE
• Spring
- Custom namespace with XML tags for routing
• Scala
- Adding some Scala features on top of the Java DSL

44
Domain-Specific Language for Integration

Java:
from(„file://test“)
.choice()
.when(xpath(„//order/type=‚widget‘“))
.to(„jms:widgetOrderQueue“)
.otherwise()
.to(„jms:gadgetOrderQueue“);
XML:
<route>
<from uri=„file://test“>
<choice>
<when>
<xpath>//order/type=‚widget‘</xpath>
<to uri=„jms:widgetOrderQueue “/>
</when>
<otherwise><to uri=„jms:gadgetOrderQueue “/></otherwise>
</from>
</route>

55
Message Model

Abstractions in Camel
• Message (org.apache.camel.Message)
• Exchange (org.apache.camel.Exchange)

66
Message

• Entity used by the applications to communicate, using


the messaging channel
• One-direction only: sender to receiver

77
Message Structure

• Has a body (payload)


• Identified by a string-typed ID
• Headers hold message-related
information
- encoding
- authentication credentials
• Body contains the message value

88
Message Exchange

• Exchange ID
• Message exchange patterns
(MEP)
• Exception
• Properties
• In Message
• Out Message

99
Architecture

10
10
Endpoints

• A Camel abstraction to represent a channel endpoint


• Points from which messages are sent and received
• Message endpoints typically referenced by a URI

• Camel supports throttling, load balancing and multicast


(distribution to multiple endpoints simultaneously)
11
11
Architecture – End Point

1. Camel component
2. data/inbox refers to the root directory
3. delay=5000 files looked for every 5 seconds (polling consumer)

Endpoint configured with URI


Refer to it with URI
When running, Camel will look for an endpoint based on this URI

12
12
Producer/Consumer Endpoints
Two Basic Examples

Event

Route Process Route Producer endpoint


Consumer endpoint exchange

Event

example.txt

Route
File:C:/temp/data File:D:/receive

• Consumer endpoint • Producer endpoint


• Uses cFile • Uses cFile

example.txt

13
13
Camel Context

• A container of many different services that contains

14
14
Camel components in Talend
http://camel.apache.org/components.html

• To consume sources and produce destinations


- cFile, cDirect, cDirectVM, cCXF, cFTP, cJMS
• For any other use the generic Camel component
- cMessagingEndPoint

Note: Talend supports many (but not all) Camel components in the within the Studio.

15
15
© Talend Inc. 2015
16
16
Message Processing
Routes

©2015 Talend Inc.

Talend Education Department 11


Lesson Overview

• Learn about and build Routes to help with common Enterprise


Integration Patterns (EIPs)
• Incorporate JavaBeans into a Route
• Basic error handling

22
Lesson Objectives

After completing this lesson, you will be able to:


• Design and run Routes that
- Use Enterprise Integration Patterns (EIPs)
• MessageRouter pattern for Content-Based Routing
- Sends a message through a series of processing steps that are not
known at design time
- Uses custom JavaBean code to process data
- Uses Apache Camel flatpack component to convert file formats
- Route messages to endpoints

33
Lesson Labs

• Content Based Routing (Message Router)


• Routing Slip
• Multicast
• WireTap

44
Content Based Routing

©2015 Talend Inc.

55
Overview
Content Based Routing

• Route message to destination based on its content


• Use Message Router EIP

Description Key Component


Reads an XML file (customer order info) cFile*
Routes messages to different channels based on cMessageRouter
specified conditions

* Additional Key Component previously discussed

66
cMessageRouter

• Purpose
- Route messages based on specified conditions
• Common Configuration
- When Trigger - Whe spe ified o ditio o urs, route this a …
• Rt-click component > Trigger > When
– Rt-click When link > Settings
• Select Type (XPath, Ruby, Python, JavaScript, …
• E ter Co ditio /E plo ee/ID=
• Can have > 1 When Trigger
- Otherwise Trigger - Route all messages not meeting When condition
• Can have exactly 0 or 1 (optional)
• Warning! Do t perfor additio al essage ha dli g after a When
or Otherwise link! (best practice)

77
Lab Overview & Goal
Content Based Routing

• Goal: Route message based on content within an XML file


• Steps
- Create the Route
- Place cFile and configure message sources & destinations
- Place cMessageRouter
• Configure When Trigger
– Type: XPath
if (FirstName = Fred) then route Out/Fred
– Condition Pseudo code else if (FirstName = Barney) route Out/Barney
else route Out/Others
• Configure Otherwise Trigger
• Run Route and examine results
• Change configuration slightly and re-run

Perform the Content Based Routing Lab exercise before continuing with the presentation.

©2015 Talend Inc. 88


Completed Lab View
Content Based Routing

99
Routing Slip

©2015 Talend Inc.

10
10
Overview
Routing Slip

• Route message(s) to one or more endpoints using RoutingSlip EIP


• Common use case
- Send each row of an input file as a message (not the entire file)
• Message Processing Routes
- Static or Dynamic flow Upcoming RoutingSlip Lab is
- Single or multiple endpoints dynamic with multiple endpoints

Description Key Component*


Produce/consume messages synchronously cDirect
Sets headers on each message sent to component cSetHeader

Follows
Route messages through series of processing steps cRoutingSlip
Log message exchanges cLog

*Additional Key Components used but previously discussed: cFile, cMessagingEndpoint

11
11
cDirect

• Purpose
- Produce (or consume) messages synchronously within a single Camel
context
- Can be used as a start, middle or end component
• Common Configuration
- Name (if a starting component)

12
12
cSetHeader

• Purpose
- Set or customize headers on all messages sent to it
- Precedes a cRoutingSlip component
• “et Header = o sta t – Static route (e.g. A, B, C no matter what)
• Header ot o sta t – Dynamic route e.g. A, B, C , the A, C, the A, B…
• Common Configuration
- Headers
• Name – Message header name
• Language – Language to use for the expression
– E a ples: Ja a“ ript, Bea , XPath, ‘u , P tho , Groo , …
• Value – Expression to set the header value to

13
13
cRoutingSlip

• Purpose
- Route one or more messages consecutively to a series of endpoints
- Middle or end component
- Always follows a cSetHeader
• Common Configuration
- Header name
• Name of header as defined in previous cSetHeader
- URI delimiter
• Character that separates multiple endpoints URIs in the message header
• Default: comma (,)

14
14
Lab Overview & Goal (1 of 2)
Routing Slip

• Goal: Determine if a customer sales order file should have a


discount applied or not
• Steps
- Create a ReadDiscount Java Bean with discount code/logic in it
- Split input file into multiple Sales Orders (cMessagingEndpoint with
FlatPack parser)
- Create, process and log (cLog)
• Direct:billing • cRoutingSlip processes applied to every line of input file
• Direct:receipt
• Direct:discount • Only applied if Discount > 0.0

Proceed to the next slide before performing the Lab exercise

©2015 Talend Inc. 15


15
Lab Overview & Goal (2 of 2)
Routing Slip – Additional Details

Determine if a customer sales order qualifies for a discount


• Flatpack option of cMessagingEndpoint component to parse input
file line by line
• cRoutingSlip to send messages through processing steps
• ReadDiscount JavaBean to analyze/apply discount logic
• cSetHeader to create a new variable in the message header based
on the value returned by JavaBean
Call the flatpack Message consumer Create a header
File Consumer
sub-route flatpack through a Bean

Perform the Routing Slip Lab exercise before continuing with the presentation

©2015 Talend Inc. 16


16
Completed Lab View
Content Based Routing

RoutingSlip Billing

Discount

Receipt

Note: Exact labels and placement may vary.

17
17
Multicast

©2015 Talend Inc.

18
18
Overview
Multicast

• Send a route to multiple endpoints simultaneously


• Many components used (in next lab)

Description Key Component*

Review
Send or receive messages cMessagingEndpoint
Sets headers on each message sent to component cSetHeader
Route messages to multiple endpoints (at same time) cMulticast Key!
Generate message exchanges based on timer trigger cTimer
Invoke a Java Bean from the repository cBean

New
Replace content of the message payload cSetBody
Quick way to implement basic Java DSL cJavaDSLProcessor

19
19
cMulticast

• Purpose
- Route message simultaneously to several endpoints
- Message can be processed differently
- Differs from cSplitter in that the original request message is unaltered
• Common Configuration
- URIs – Specify all endpoints for message routing
- Use Parallel Processing
• Set timeout - In milliseconds, only available if parallel processing
- Stop on exception

20
20
cTimer

• Purpose
- Generate a message exchange when a timer triggers
- Must be a staring component
• Common Configuration
- Period – Period (in milliseconds) to generate messages
- Repeat – Max number of messages to generate (0 = unlimited)
- Delay – Number of ms to wait before generating 1st message
- Daemon – Run timer thread as a daemon or not
- Set Schedule Time – Set time/date for the first message to trigger

21
21
cSetBody

• Purpose
- Replaces the payload of every message sent to it
- Content replaced is based on what an expression evaluates to
• Common Configuration
- Language – Ja a“ ript, XPath, XQuer , ‘u , P tho , “i ple, “QL…
- Expression – Expression to evaluate (for payload replacement)
- If Language = XPath - Can add namespaces for the expression

22
22
Lab Overview & Goal
Multicast

• Goal: Use the Multicast EIP to route messages based on their


currency type (US dollars, Euros or Chinese Yen)
• Steps
- Create Route and Bean
• Bean used to add new info to each endpoint (currency type)
- Place all components and configure
• Set timer
• Set headers (country and currency)
• Call bean (to set price)
• Configure message to log
- Run and examine results

Perform the Multicast Lab exercise now before continuing with this presentation.

©2015 Talend Inc. 23


23
Completed Lab View
MultiCast

Note: Exact labels and placement may vary.

24
24
WireTap

©2015 Talend Inc.

25
25
cWireTap

• Purpose
- Wiretaps a message, sending it to both the original endpoint and
another endpoint
• Common Configuration
- URI – Endpoint to send the wiretapped message
• E a ples: direct:log , direct:A
• Common use case
- Assist with logging (easily determine what a Route does, when and
where…
- Listen in on original Route, output to a log file (or console) for
examination

26
26
cSplitter

• Purpose
- Splits a message into several sub-messages
- Split is performed based on a condition you specify
• Common Configuration
- Language – Language of the expression. Many supported:
• Examples: Xpath, Ruby, Python, SQL, Groovy, Simple
- Expression – How to split the messages
- Stop on Exception – Stop processing immediately on error
- Timeout – Specify in milliseconds

27
27
Lab Overview & Goal
WireTap

• Goal: Use WireTap EIP to tap into a message and send it to multiple
endpoints simultaneously
• Steps
- Configure input message endpoint (cFile)
- Wiretap the message (cWireTap)
- Split the message (cSplitter)
- Log output (cLog)
• Original content unaltered
• Set INFO and WARN debug levels
• Log original message
• Log Wiretap message
• Run Route and examine results
Perform the WireTap Lab exercise before completing this presentation.

©2015 Talend Inc. 28


28
Completed Lab View
WireTap

Note: Exact labels and placement may vary.

29
29
Lesson Summary / Q&A

• Integration challenges facing enterprises pertain to several common


patterns
• Common Enterprise Integration Patterns (EIPs) include:
- Message Router (Content Based Routing)
- RoutingSlip
- MultiCast
- WireTap
• Apache Camel supports most EIPs
• Talend ESB is based on Apache Camel

30
30
Additional Information

• Apache Camel
- Components - http://camel.apache.org/components.html
- EIPs - http://camel.apache.org/enterprise-integration-patterns.html
• http://www.enterpriseintegrationpatterns.com/
• XML and XPath
- http://www.w3.org/xml
- W3schools (http://www.w3schools.com/xml)
- W3schools (http://www.w3schools.com/xpath)
• Online Help (each component)
- Place component in the workspace
- Select component & click F1
- Click Component Documentation link
31
31
© Talend Inc. 2015
32
32
Connecting Routes
Routes that communicate with other Routes

©2015 Talend Inc.

1
Lesson Overview

• Create a Route
- Read an XML file
- Split the file into multiple messages
Routes that communicate with each other
- Connect to an input queue
- Place messages on the queue
• Create another Route
- Connect to the input queue
- Read messages from the queue
- Process/transform the messages (via series of components)

©2015 Talend Inc. 2


Lesson Objectives

• After completing this lesson, you will be able to:


- Create Context Groups with multiple Context Variables
- Create multiple Routes that communicate with each other (via a
messaging queue)
- Configure many powerful Camel and Talend components
- Set message headers
• 1:1 (component:header)
• 1:many (component:multiple headers)
- Handles exceptions with the cTry component

©2015 Talend Inc. 3


Lesson Labs

• Connection Route
Routes communicate and work together
• Process Route
• Multiple Headers
• ESB Resources

©2015 Talend Inc. 4


Terminology

• Producer – Produces content and puts it in a queue In context of this


Connecting Routes
• Consumer – Read (i.e. consumes) content from a queue Lesson

• JMS – Java Messaging Service (such as Apache ActiveMQ)


• XPath – XML expression language for pattern matching
• XSD – XML Schema Description. Formal description of an XML doc.

©2015 Talend Inc. 5


Apache ActiveMQ - Summary

• ActiveMQ
- Open source messaging broker
- Includes a full JMS client
- Apache Camel uses ActiveMQ for messaging
- See also
• http://www.activemq.apache.org
• Technical Detour - Apache ActiveMQ (and Camel)
• Talend ESB
- Uses ActiveMQ as a Java Messaging Service (JMS) for Routes
- ActiveMQ must be running as a service (for Routes to work)

6
Connection Routes

©2015 Talend Inc.

7
Overview
Connection Routes

• Create first of two Routes that will communicate with another Route

Description Key Component


Creates a persistent connection to the message broker cMQConnectionFactory
Reads an XML file (customer order info) cFile*

Review
Sets headers on each message sent to component cSetHeader*
Splits file into multiple messages (individual orders) cSplitter*
Deposit messages into queue cJMS

* Additional Key Components (previously discussed): cFile, cSetHeader, cSplitter


8
Process an XML file via JMS Queue
Customer order validation using two Routes

Use the header in


routing_Slips

XML
order
Log-start
XML XML
orders
XML
order
Queue order
Archive
XML
order Use the header : Validate
• ArchivePath
Add a header : • OrderId Output
• archivePath
• Routing_Slips
• orderId

File_to_JMSqueue Msg_from_JMS_Q_to_Processor

This section… … next section

9
cMQConnectionFactory

• Purpose
- Store connection information to connect to a MQ Server
- Used by other components (e.g. cJMS)
• Common Configuration
- MQ Server - Specify type of MQ Server
• Examples: ActiveMQ, Websphere
- Broker URI – URI of the message broker
- Authentication – User/password information

10
cJMS

• Purpose
- Producer – Send messages to a JMS queue*
- Consumer – Read messages from a JMS queue*
• Common Configuration
- URI Destination – Name for the queue*
- Connection Factory – Contains connection info for the queue
(cMQConnectionFactory settings)

*Topics are also supported. (But queues are used throughout this Lesson and associated Labs.)

11
Lab Overview & Goal
Connection Route

• Goal: Create a Route that produces messages for a queue that will
be read and processed by another Route
• Steps
- Connect to a JMS (ActiveMQ) queue
- Create Context Group
- Read an XML file with customer order information
- Split the file into individual orders
• Path to archive
- Set headers on the messages • Order ID number
• Specify next processing steps
- Write to the queue
• Run the Route
• Examine the queue

Perform the Connection Route Lab exercise before continuing with slides

©2015 Talend Inc. 12


Completed Lab View
FileToJMSQueue

Note: Exact labels and placement may vary.

13
Process Route

©2015 Talend Inc.

14
Overview

• Create second of two Routes that reads messages from a queue


(put there by the first Route)
• Process the messages and route accordingly (including valid/invalid
orders and error handling)
Description Key Component
Route messages to a series of endpoints cRoutingSlip*
Quickly implement (small amount of) java code cProcessor
Produce/consume messages synchronously cDirect*
Route messages to multiple user defined recipients cRecipientList
Send/receive messages cMessagingEndpoint*
Used for error handling cTry
* Additional Key Components (previously discussed): cRoutingSlip, cMQConnectionFactory, cSetHeader, cJMS, cFile,
cDirect, cMessagingEndpoint

15
Review - Process an XML file via JMS Queue
Customer order validation using two Routes

Use the header in


routing_Slips

XML
order
Log-start
XML XML
orders
XML
order
Queue order
Archive
XML
order Use the header : Validate
• ArchivePath
Add a header : • OrderId Output
• archivePath
• Routing_Slips
• orderId

File_to_JMSqueue Msg_from_JMS_Q_to_Processor

DONE … … You are HERE

16
cRecipientList

• Purpose
- Route messages to a list of recipients
• Common Configuration
- Language – Set the language type for the expression (Simple, Xpath, …)
- Expression – Expression that returns the endpoints
- Parallel Processing – Send to all recipients simultaneously
- Stop on Exception
- Ignore Invalid Endpoints
- Timeout – Tim (in ms) for recipients to receive and process messages

17
cTry

• Purpose
- Exception (error) handling
- Implements Java Try/Catch/Finally blocks
• Row Connections
- Try – Part of route that likely needs error handling
- Catch – Type of exceptions to catch (e.g. Exception.class to catch all)
- Finally – Final instructions to execute
- Route – Route all messages from sender to the next endpoint

18
cProcessor

• Purpose
- Quick/simple way to implement (java) code
- Great for basics and testing (not ideal for lengthy or complex code)
- Often used with cTry to catch exceptions and write to system console
• Common Configuration
- Code – Java code to execute
- Imports – Java code to import external libraries (if needed)

Note: Code should be basic. If too complex, it should be refactored or perhaps a JavaBean.

19
Lab Overview & Goal
Process Route

• Goal: Read messages from the queue, process and route them
based on Order validity
• Steps
- Connect to a JMS queue (contains Orders)
- Read messages from the queue
- Process the order based on message headers
• Initialize/start of the audit
• Archive to designated folder
• Validate the Orders (against an XSD)
• Log end of the audit
- Implement error handling for invalid customer orders
- Run Route (and confirm proper results)
Perform the Process Route Lab exercise before continuing with slides

©2015 Talend Inc. 20


Completed Lab View

Msg_from_JMS_Q_to_Processor

Note: Exact labels and placement may vary.

21
Multiple Headers

©2015 Talend Inc.

22
Overview

• Multiple cSetHeader components


- Multiple components with a single header
- Can be easier when learning
• Single cSetHeader components
- Single component with multiple headers
- Simplified look on final Route
- Consolidation considered best practice

23
Lab Overview & Goal
Multiple Headers

• Goal: Consolidate multiple cSetHeader components down to one


• Steps
- Duplicate File_to_JMS_queue Route
- Delete one cSetHeader
- Modify remaining cSetHeader
• Add addition headers to it
- Reconnect and Run Route

Perform the Multiple Headers Lab exercise before continuing with the presentation

©2015 Talend Inc. 24


ESB Resources

©2015 Talend Inc.

25
Overview

• Purpose – External Resources that can be used in a Route


• Examples
- XSD file for XML file validation
- WSDL file for Camel-CXF based Route
- XQuery for use in Camel-Saxon based Route
• Functionality
- Ca create a d edit directl fro the Studio… or…
- … Browse to e ter al file i the files s ste
- Supports basic versioning
- Copy Path (to buffer for component configuration)

26
Lab Overview & Goal
ESB Resources

• Goal: Use an existing external Resource in a new Route


• Steps
- Create a new Resource in the Studio
• Point it to an existing in the file system
• Customer Transaction includes: ID, Name, Transaction ID and Amount
- Create a new Route
• Add co po e ts…
• Add cMessagingEndpoint component
– Use Customer Transaction Resource to configure the URI
• Co figure other co po e ts…
• Run and examine output
Note: If time is an issue, you can read this exercise in the Lab Guide and skip the steps on your VM.

Perform the ESB Resources Lab exercise before finishing this Lesson’s presentation.

©2015 Talend Inc. 27


Lesson Summary / Q&A

• Create a Producer Route


- Write to a JMS queue (Apache ActiveMQ) Routes that communicate
via a single queue
• Create a Consumer Route
- Read from the same JMS queue
• Set multiple headers from a single component
• Use (reusable) ESB resources in a Route

28
Additional Information

• http://www.activemq.apache.org
• Technical Detour - Apache ActiveMQ (and Camel)
• On line Help (Component Reference Guide)

29
© Talend Inc. 2015
30
Apache ActiveMQ
Technical Detour

©2015 Talend Inc.

11
Apache ActiveMQ (1 of 2)

• Apache Software Foundation


- Open source, community led
- http://apache.org
• Project of the Apache Software Foundation
- http://activemq.apache.org
- Messaging technology that joins start/endpoints
- Enables messaging from different sources… to different destinations
• Makes integration easier
- Implements common Enterprise Integration Patterns (EIPs)
- Connects to many transports and APIs
- Easy to use Domain Specific Languages (DSLs) to bring EIPs and
transports together
• Extensive component library
22
Apache ActiveMQ (2 of 2)

• Based on standards
• Message-Oriented Middleware
• Multi-channel
• Multi-platform
• Multi-language (Client)

33
ActiveMQ Architecture

44
ActiveMQ - Message Oriented Middleware

55
ActiveMQ - Enterprise Messaging

66
ActiveMQ – Point to Point Queue

77
ActiveMQ – Publish/Subscribe

88
© Talend Inc. 2015
99
Developing Routes
that call DI Jobs

©2015 Talend Inc.

11
Lesson Overview

• Develop Routes (Mediation perspective) and Jobs (Integration


perspective) that exchange messages
• Load balance the message exchanges

22
Lesson Objectives

After completing this lesson, you will be able to:


• Design and run a Route that
• calls a Data Integration Job
• takes data from the DI Job and uses it for output in the Route
• uses Load Balancing to create different paths through the Route
• Use both Mediation and Integration perspectives in concert to meet
these objectives

33
Lesson Labs

• Creating DI Jobs
• Creating a Route to call DI Jobs

44
Common Use Cases

• Why call DI Jobs from Mediation Routes?


- Proficient in DI already
- Not expert Java programmer
- New to ESB
- Complex transformations required
• Altering a database
• Power and flexibility of tMap to transform a message
• Apply a matching algorithm via tMatchGroup component
• Analogy
- JavaBea is to Java…
- … as a DI Jo is to a Route

55
Creating DI Jobs

©2015 Talend Inc.

66
Overview
DI Job (called by a Route)

• Create basic Integration Jobs that will be called by and


communicate with a Route

Description Key Component


Accepts messages from a Route tRouteInput
Transform and route data tMap*
Sends messages from a Job to a Route tRouteOutput

* Additional Key Component (Very powerful, commonly used component covered in DI Basics course)
77
tRouteInput

• Purpose
- Accept messages from a Mediation Route
- Must be launched from a Route using a cTalendJob component
• Common Configuration
- Input Schema – Built-in or Repository Similar to what is commonly
- Edit S he a… seen in DI and DQ

- Camel – Message parameters in Simple Expression Language format

88
tRouteOutput

• Purpose
- Sends a message from a Job to a Route
- A Job using this component must be called by a Route using cTalendJob
(similar to tRouteInput)
• Common Configuration
- Output schema – Built-in or Repository
- Edit schema …
- Camel – Message parameters in accord with columns (defined by schema)
• Type – Body, Property, System or Header (default = Header)
• Name – Set the name for the parameter (ignored if Type = Body)

tRouteFault - Similar to tRouteOutput but message is marked as a “fault”. (Not used in upcoming lab exercise.)

99
Lab Overview & Goal
Creating DI Jobs

• Goal: Create two basic DI Jobs that are called by a Mediation Route
- Each Job clearly identifies itself (to make Route/Job communication
confirmation clear)
- Info will be exchanged between the Route and Jobs (next lab)
• Steps
- Create the 1st Job
- Use two key ESB Components
• tRouteInput & tRouteOutput
- Configure tMap to perform a basic transform between the input/output
data flows
- Duplicate the 1st Job and make minor modifications

Perform the Creating DI Jobs Lab exercise before completing this presentation.

©2015 Talend Inc. 10


10
Mediation Route that calls
Integration Jobs

©2015 Talend Inc.

11
11
Overview
Route that calls a Job

• Develop Routes in the Mediation perspective that can invoke Jobs in


the Integration perspective
• For Jobs/Routes to exchange messages requires key components

Mediation Perspective Integration Perspective


Routes Messages Jobs
•cTalendJob •tRouteInput
•tRouteOutput

Description Key Component


Accepts messages from a Route cLoadBalancer
Transform and route data cTalendJob

Note: Additional Key Components (previously discussed): cTimer, cSetBody, cDirect, cLog

12
12
cLoadBalancer

• Purpose
- Send message across multiple endpoints
- Supports many common algorithms (strategies)
• Common Configuration
- Strategy
• Round Robin – Distribute evenly among all endpoints
• Random
• Sticky – Calculation determines what endpoint to route to
• Failover – Use first endpoint. If it fails, try remaining endpoints.

13
13
cTalendJob

• Purpose
- Calls a Talend Job from a Mediation Route
- Enables Routes and Jobs to exchange messages
- Requires a tRouteInput be used in the Job
• Common Configuration
- Repository – Call a Job from the Repository
• Specify Context (Job, Route or Selected context)
- External – Job from an external bundle, specify:
• Library jar file
• Job – Specify package and job name (<PackageName>.<JobName>)
• Context name

14
14
Lab Overview & Goal
Creating a Route to Call Jobs

• Goal: Develop a Route that calls the DI Jobs just created


- Key takeaway is how to exchange messaging between Integration and
Mediation perspectives (Jobs and Routes)
• Steps
- Set a timer to trigger the message exchange (cTimer)
- Set the message body (cSetMessage)
- Load balance the messages to the two DI Jobs (cLoadBalancer)
- Set up the producers and consumers of the messages
• Uses multiple cDirect components for the data exchange
- Set up logging (cLog, which helps when examining the results)
• Run Route and examine results

Perform the Creating Route to Call Jobs Lab exercise before completing this presentation.

©2015 Talend Inc. 15


15
Completed Lab View
All Lesson Labs

Job A

Job B

Route that calls


Job A & B

16
16
Lesson Summary / Q&A

• Several key components enable the message exchange between Routes


and Jobs
- Routes: cTalendJob
- Jobs: tRouteInput, tRouteOutput
• cLoadBalancer supports several common strategies to distribute the
messages

17
17
Additional Information

• Apache Camel Simple Expression Language


- http://camel.apache.org/simple.html
• Wikipedia Load Balancing
- https://en.wikipedia.org/wiki/Load_balancing_(computing)

18
18
© Talend Inc. 2015
19
19
Developing SOAP
Web Services

©2015 Talend Inc.

1
Lesson Overview

• Introduction
- Web Services
- SOAP Web Services
- Apache CXF
- Talend ESB and Web Services
• SOAP Labs
- Create SOAP provider
- Test SOAP provider
- Develop SOAP consumer
- SOAP access to a database
- SOAP test via database access
- Additional SOAP tests

2
Lesson Objectives

• Describe Web Services


• Describe Features of SOAP Web Services
• Describe how Apache CXF is used in Talend Studio

3
Introduction
• Web Services, SOAP,
• Apache CXF, Talend

©2015 Talend Inc.

4
Web Services

• Applications communicating over a network


• A standard way of interoperation of different platforms and
frameworks
• Have a software component provided through a network endpoint
• Use messages to exchange request/response info
• Types:
- Simple Object Access Protocol (SOAP) This lesson

- Representational State Transfer (REST) Next lesson

5
SOAP Web Services

• XML message format


• For communicating between applications
• Operation oriented
• Contract first
- WSDL file contract for service provider and consumer
- Identifying service operations
- Request and response
• HTTP – Application layer transport (normally used by SOAP)

6
What is CXF?

• An open-source Web services framework


- Uses programming APIs
• JAX-WS (Java, WSDL)
• JAX-RS (RESTful)
• HTTP Binding
- Multiple protocols
• SOAP
• XML/HTTP
• RESTful HTTP
- Transports
• HTTP
• JMS
• WebSocket
- WS-* standards
• http://cxf.apache.org/

7
Apache CXF

8
Talend ESB and Web Services

• Ease of use for web service developers


- Configuration
- Programming
• Add custom SOAP headers
• Use Integration perspective to create web services

9
Talend ESB SOAP Web Service Components

Components used to wrap Talend Jobs as SOAP web services

Description SOAP Components


Waits for request message from a consumer tESBProviderRequest
Returns a SOAP response tESBProviderResponse
Fault handling for web service response tESBProviderFault
Invokes a method through a web service tESBConsumer*

*Not used in upcoming lab exercise. (Other three components are.)


10
SOAP Labs

©2015 Talend Inc.

11
Lab Overview & Goal
Create SOAP Provider

• Goal: Create a basic SOAP Service provider and publish it to an


endpoint (service URL)
• Steps
- Create Service to echo input
- Import WSDL
- Create & Assign Job for the echo Service
• Connect and configure components (tESBProviderRequest/Response)
- Run Job
- Test service endpoint URL (read WSDL contract)

Proceed to the next Lab Overview slide before completing both Lab exercises.

©2015 Talend Inc. 12


Lab Overview & Goal
Test SOAP Provider

• Goal: Use SoapUI tool to test the SOAP Provider just created
- Publish requests and view responses in a simple to use GUI
• Steps
- Invoke SmartBear SoapUI
- Create new Project
- Read in the WSDL (http://<Host>:<Port><PublishedURL>?wsdl)
- Change the request
- Submit the request
- View the response

Perform the Create SOAP Provider and Test SOAP Provider Lab exercises before continuing with the Presentation.

©2015 Talend Inc. 13


Lab Overview & Goal
Develop SOAP Consumer

• Goal: Create a SOAP Consumer to work with the previously created


SOAP Producer
• Steps
- Create Job
- Define and configure WSDL (using tESBConsumer)
- Edit the schema (to customize the message)
- Add components for
• Input data flow (tFixedFlowInput)
• Transformation of the message (tMap)
• Logging (tLowRow)
- Run the Job
• Confirm the message is consumed, transformed, and output correctly
Perform the Develop SOAP Consumer Lab now before proceeding with the Presentation.

©2015 Talend Inc. 14


Lab Overview & Goal
Database Access with SOAP

• Goal: Access MySQL database from a SOAP Web Service


• Steps
- Create new Service
- Create new WSDL
- Create database connection info & retrieve schema (product info)
- Define SOAP schemas (WSDL)
• Request and response
- Create Job and assign to SOAP operation
• Get product info: Name, Description, Price
• Uses tESBProviderRequest/Response
- Import XML schemas (request and response)
- Run the Job (used with next Lab)

Perform the Database Access with SOAP Lab now before proceeding with the Presentation.

©2015 Talend Inc. 15


Lab Overview & Goal
Test SOAP Web Service

• Goal: Use SoapUI tool to test the SOAP Web Service just created
• Steps
- Start SoapUI
• Create Project
• Point it to new WSDL endpoint URL
• Issue several valid requests
Confirm correct responses
• Issue invalid requests

Perform the Test SOAP Web Service Lab now before proceeding with the Presentation.

©2015 Talend Inc. 16


Lab Overview & Goal
Additional Test Options

• Goal: Use MySQL Workbench & MySQL command line to directly


access the database in order to compare to SoapUI
request/response results.
- Also prohibit the SOAP web service to continually listen for input on its
endpoint
• Steps
- Connect to MySQL Workbench
• Issue queries and view results
- Connect to MySQL database directly from the command line
• Issue queries an view results
- Change tESBProviderRequest
• Un-select Keep Listening and test

Perform the Additional Test Options Lab now before proceeding with the Presentation.

©2015 Talend Inc. 17


More Information

• Talend Documentation
- http://help.talend.com
- Online Help
• Apache CXF
• http://cxf.apache.org
• SOAP and WSDL Tutorials
- http://www.w3schools.com/webservices/

18
© Talend Inc. 2015

19
Developing REST Web
Services

©2015 Talend Inc.

11
Lesson Overview

• Introduction
- REST Web Services
- REST vs. SOAP (at a glance)
• Lesson Lab
- Create REST Web Services

22
Lesson Objectives

• Describe Features of REST Web Services


• Describe basic differences between REST and SOAP
• Wrap a Talend Job as a REST Web Service
• Database access from a REST Web Service

33
Introduction
• RESTful Web Services,
• REST vs. SOAP

©2015 Talend Inc.

44
RESTful Web Services

• For communicating between applications


• Based on HTTP
• Uses XML
• Contract not required (e.g. WSDL/SOAP)
• API has same operations
- GET, PUT, POST, DELETE, HEAD
• Uses URI for operations
- Return purchase history for Customer number 1234
- GET http://www.example.com/customer/1234/purchased
• Response oriented

55
REST and SOAP – Differences at a Glance

• Simple Object Access Protocol • Representational State Transfer


• Independent of transport • HTTP only (in practice)
• SSL support • SSL support
• Requires a contract (WSDL) • No contract, self defining
• Operation oriented • Resource oriented
• XML payload - GET, PUT, POST, DELETE, HEAD
• When use SOAP? • When use REST?
- If governance & increased - Simpler (yet as powerful), more
security are largest priority performant & allows different
data formats

66
REST Labs
• Key Request/Response Components

©2015 Talend Inc.

77
Talend ESB and Web Services

• SOAP
- tESBProviderRequest
Covered in previous lesson
- tESBProviderResponse
- tESBConsumer
• REST
Description REST Components
Receives HTTP/s requests (GET, PUT, POST, DELETE) from a tRESTRequest
client
Sends HTTP/s responses to the client tRESTResponse
Send HTTP/s requests to a RESTful web service (and gets tRESTClient*
responses)
Like tRESTClient (but arguably simpler and less powerful) tREST*

*Not used in the upcoming lab exercise.


88
tRESTRequest

• Purpose
- Receives HTTP/s requests (GET, POST, PUT, DELETE) from client
- Used with tRESTResponse to wrap a Talend Job as a web service
- Server side component
• Common Configuration
- REST Endpoint – Root URI the RESTful web service listens at
- REST API Mapping – Add multiple mappings for output flows (operations
such as GetEmployees to HTTP ethods GET, PUT, PO“T, … a d the
spe ifi URI Patter /Nu er

REST Endpoint
GetEmployees GET http://SomeHost.com:8088/employees/number
REST API Mapping

99
tRESTResponse

• Purpose
- Return HTTP/s responses to the client
• Common Configuration
- Return Body Type – Document, String or Byte
- Return Status Code – Standard HTTP response codes
• 200 OK; 400 Bad Request; 404 Not Found; 500 Internal Server Error
• Custom return code also supported

10
10
Lab Overview & Goal
Create REST Web Services

• Goal: Create a REST Web Service that looks up and returns product
information from a database
• Steps
- Create Job
- Add and configure components (tRESTRequest/Response, tXMLMap, …
- Add operation for getting all product information (getAllProducts)
- Configure database connection (talendstore)
- Configure mapping (input to output transformation)
• Input: Database
• Output: XML document
- Run Job and examine XML response
• Test against published URL (http://localhost:8088/products)
Perform the Create REST Web Service Lab exercise before continuing with slides

©2015 Talend Inc. 11


11
Lesson Summary / Q&A

• REST tends to be simpler and lighter weight than SOAP


• REST is arguably more pervasive than SOAP
- Continues to gain momentum
• tRESTRequest, tRESTResponse are key components
- Enable a Talend Job to be wrapped as a REST Web Service

12
12
Additional Information

• Talend Documentation
- http://help.talend.com
- Online Help
• Apache CXF
- http://cxf.apache.org
• REST Tutorial
- http://www.restapitutorial.com/

13
13
© Talend Inc. 2015

14
14
Talend ESB Basics 6.0
Training
Wrap Up

©2015 Talend Inc.

1
Class Recap

- Explored the basic functionality of Talend Studio for ESB


- Build, ran, and examined results of Talend ESB Routes
- Build, ran and examined results of Talend DI Jobs
- Accessed and configured a variety of Talend and Camel components
using Enterprise Integration Patterns
- Created Web Services (SOAP & REST)

2
Enterprise Integration Patterns

EIPs used in labs:


– Integration Styles
• File Transfer (cFile)
• Messaging (cMQConnectionFactory)
– System Management
• Wire Tap (cWireTap)
• Log (cLog)
– Message Routing
• Content-Based Router (cMessageRouter)
• Recipient List (cRecipientList)
• Splitter (cSplitter)
• Routing Slip (cRoutingSlip)

3
SOAP & REST Web Services

• SOAP components:
– tESBProviderRequest
– tESBProviderResponse
– tESBConsumer
• REST components:
– tRESTRequest
– tRESTResponse

4
What’s Next?

- ESB Training:
• Talend Enterprise ESB
– ESB Conductor, ESB Runtime, ESB Publisher and Talend Administration Center (TAC)
- Other Talend Training:
• Working with Apache Camel
• Working with Apache ActiveMQ
• Working with Apache CXF

5
Documentation

• Talend Open Studio for ESB User Guide


• Talend Open Studio for ESB Installation and Upgrade Guide
• Talend Open Studio ESB and ESB SE Release Notes
• Talend Open Studio Components and Reference Guide
• Talend ESB Getting Started Guide
• Talend ESB Mediation Components Reference Guide
• Talend ESB Mediation Developers Guide

6
Additional Information

• Forum: www.talendforge.org/forum
• Talend Help: help.talend.com
• Talend Exchange: www.talendforge.org/exchange/
• On Demand Webinars: www.talend.com/resources/webinars
• Tutorials: www.talendforge.org/tutorials
• Talend YouTube: www.youtube.com/user/TalendChannel

You might also like