Top Banner
1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt [email protected] Zsolt Beothy-Elo zbeothy- [email protected]
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

1© Talend 2014

Service LocatorTalend ESB Training 2014

Jan [email protected]

Zsolt [email protected]

Page 2: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

2© Talend 2014

Agenda

➜ Introduction to Service Locator• Problem Definition• Concepts

• Loose Coupling• Automatic Failover• Selection Strategies

• Common Pitfalls➜ Hands-on

• Installation & Configuration• Demo Service using Service Locator

Page 3: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

3© Talend 2014

Introduction toService Locator

Page 4: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

4© Talend 2014

Problem: Tight Coupling

➜ Direct invocation from Application A to Service X• Static endpoint address

Application A Service Xinvokes

Page 5: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

5© Talend 2014

Application A Service Xinvokes

Problem: Tight Coupling (Service Blackout)

➜ Service X goes offline• Application A stops working as well• Application A needs to be fixed

• Reconfiguration• or even redeployment

Page 6: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

6© Talend 2014

Application Ainvokes

Problem: Tight Coupling (Relocation)

➜ Service X was moved to a new location• Application A stops working• Application A needs to be fixed

• Reconfiguration• or even redeployment

Application A Service X

Service X

Page 7: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

7© Talend 2014

Solution: Loose Coupling

Application A

Service Locator

SL Client Service X

SL Client

2: perfo

rms lo

okup

3: returns a

ddress

4: invokes

1: registers

Page 8: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

8© Talend 2014

Solution: Loose Coupling

Application A Service X

Service Locator

1: registers

SL Client

SL Client

Service X

SL Client

Service Y

SL Client

1: registers1: registers

3: invokes

2: perfo

rms lo

okup

3: returns a

ddress

Page 9: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

9© Talend 2014

Solution: Transparent Failover

Application A Service X

Service Locator

SL Client

Service X

SL Client

SL Client

Service Y

SL Client

1: invokes

4: invokes

Heartbeat

Heartbeat

2: perfo

rms lo

okup

3: returns a

ddress

Page 10: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

10© Talend 2014

Highlights

➜ Automatic endpoint registration• Easy to use

➜ Dynamic lookup of endpoints• No reconfiguration needed

➜ Automatic failover• Error handling is transparent to application

➜ Status monitoring• Only active endpoints are used

➜ Transparent extension• No Custom Code inside Application required

Page 11: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

11© Talend 2014

Problem: Single Point of Failure

Application A Service X

3: performs lookup

2: registers

SL Client

SL Client

Service X

SL Client

Service Y

SL Client

1: registers

2: registers

Service Locator

Page 12: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

12© Talend 2014

Solution: Distributed Services

Application A Service X

Service Locator

SL Client

Service X

Service Y

SL Client

Service Locator

Service Locator

Sync

Sync Sync

SL Client

SL Client3: performs lookup

2: registers

1: registers

2: registers

Page 13: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

13© Talend 2014

Solution: Distributed Services

Application A Service X

Service Locator

SL Client

SL Client

Service X

SL Client

Service Y

SL Client

Service Locator

Service Locator

Sync

Sync Sync

2: p

erfo

rms l

ooku

p

1: registers1: registers

4: invokes

3: re

turn

s add

ress

Heartbeat

Page 14: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

15© Talend 2014

Problem: Bad Selection

➜ Quality of Service• Poor network connectivity• Services running on weak hardware• Overload of one Service chosen by all clients

➜ Services provide different content• Video Surveillance Stream• Package Counter

➜ Producing additional costs• Some providers may charge each service invocation

Page 15: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

16© Talend 2014

Solution: Flexible Selection Strategies

➜ Round Robin• Automatic Load Balancer

➜ Metadata Selection• Localize preferred services

Page 16: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

17© Talend 2014

Common Pitfalls

➜ Stateful Services• Session State would be lost or needs to be synchronized• Sticky Selection Strategy recommended

➜ Even number of SL instances• Majority required to re-sync lost nodes

➜ Insufficient Configuration• Client needs to know multiple SL instances

Page 17: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

18© Talend 2014

Hands-on

Page 18: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

19© Talend 2014

Hands-on: Service Locator

Application A

Service Locator

SL Client Service X

SL Client

2: perfo

rms lo

okup

3: returns a

ddress

4: invokes

1: registers

Page 19: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

20© Talend 2014

Hands-on: Enable Locator

➜ Prepare services for locator feature• Add locator feature to service consumer & provider• Set Consumer address to locator://

➜ Install locator service• Locator Server• REST Interface

➜ Install service provider• One on each container

➜ Validate Results• Perform SL lookup (REST)

Page 20: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

21© Talend 2014

Hands-on: Metadata Selection

➜ Add config admin support• Add Property-Placeholder in Blueprint

• enable automatic bundle reload

• Create config file in ./etc folder➜ Add metadata to service provider

• Make location configurable➜ Add metadata filter on consumer side

• location = Bonn➜ Validate Results

• Perform SL lookup (REST)

Page 21: 1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt jbernhardt@talend.com Zsolt Beothy-Elo zbeothy-elo@talend.com.

22© Talend 2014

Thank You!