wso2 gateway

20
WSO2 Gateway Kasun Indrasiri Software Architect WSO2

Upload: kasun-indrasiri

Post on 17-Jan-2017

872 views

Category:

Engineering


4 download

TRANSCRIPT

Page 1: WSO2 Gateway

WSO2 Gateway

Kasun IndrasiriSoftware ArchitectWSO2

Page 2: WSO2 Gateway

Outline

• Introduction to WSO2 Gateway • Motivations/Objectives • High level architecture and design • Features • Message flow • Performance comparison. • Use cases• Conclusion.

Page 3: WSO2 Gateway

Introduction to WSO2 Gateway • WSO2 GW encapsulates the messaging between source and

target systems which are built with disparate technologies, protocols and standards.

Page 4: WSO2 Gateway

Motivations

• Paradigm shifts in Non-blocking IO, message/event processing, concurrent programming - Netty, Disruptor, Java 8, Reactive Programming.

• Research work - Siddhi CEP based ESB, axis2-Netty transport.• Overcome the limitations of axis2, synapse etc. • Reuse the prior knowledge and experience of building high

performance messaging systems to build a better message Gateway from the ground up.

[1] https://github.com/kasun04/siddhi-esb

Page 5: WSO2 Gateway

Objectives• To build a high performance, lightweight and reusable message

Gateway based on Gateway Pattern[1]• To be used as the foundation component of ESB, API GW, Load

Balancer, Security GW, File GW etc.

[1] http://martinfowler.com/eaaCatalog/gateway.html

Page 6: WSO2 Gateway

WSO2 Gateway – Architecture • Fully decoupled protocol handling layers from message processing layer.• Carbon Message - Data carrier between protocol handling and message

processing layers, contains message attributes and reference to message content, Message Consumers - protocol handling of inbound messages.

• Message Producers/Senders - protocol handling of outbound messages.• Message Processing Engine - process/mediate the messages.

Page 7: WSO2 Gateway

WSO2 Gateway 1.0 – Features• Ultra high performance and low latency HTTP/S messaging.• Supports thousands of concurrent connections/clients.• Header-based routing using Apache Camel as the message mediation

engine.• Defines REST services/APIs using Camel REST DSL • Lightweight and stateless service orchestration.• Load balancing and failover messaging.• Error handling support.

Page 8: WSO2 Gateway

WSO2 Gateway – Message Flow• Message receiving, processing and sending are handled with the use of

Callbacks. (No notion of Inflow and Outflow.).• Message consumer sets consumerCallback which is called by the Engine,

when the response message is ready to be sent to the client (i.e. when mediation is completed.).

• Engine sets the engineCallback which gets called by Producers when the response for a given request has arrived

Page 9: WSO2 Gateway

WSO2 Gateway – HTTP Messaging • WSO2 Gateway uses Netty based HTTP transport implemented on

message WSO2’s Pass-Thru (PT) architecture [1]. • Overcoming the consumer/producer contention in PT shared

buffer/pipe with a new blocking queue and ring buffer architecture (Disruptor).

[1] http://wso2.com/library/articles/2013/12/demystifying-wso2-esb-pass-thru-transport-part-ii/

Page 10: WSO2 Gateway

WSO2 Gateway – HTTP Transport• Netty HTTP Transport - Using executors

Page 11: WSO2 Gateway

WSO2 Gateway – HTTP Transport• Netty HTTP Transport - Using Disruptor

Page 12: WSO2 Gateway

WSO2 Gateway – Mediation Engine• Using Apache Camel as the mediation engine.

Page 13: WSO2 Gateway

WSO2 Gateway – Performance • Performance comparison for fast backend.• WSO2 GW - with Camel mediation for header based routing.• WSO2 GW is nearly 10x faster than existing WSO2 ESB’s transport.

Page 14: WSO2 Gateway

WSO2 Gateway – Performance • Handling concurrency with slow backend (5s delay).• NHTTP/BR failed at c=4k, PTT failed at c=8k, GW can go upto c=12k.• We are further enhancing high concurrency support in GW

Page 15: WSO2 Gateway

WSO2 Gateway – Performance • Latency comparison

Page 16: WSO2 Gateway

Use case I – Header-based Routing • Camel configuration for Header-based routing.

Page 17: WSO2 Gateway

Use case II – Using REST• Defining REST services for existing web APIs.

Page 18: WSO2 Gateway

Gateway in Microservices Architecture

• API Gateway is used in most real world microservice implementations to front microservices. – Eg Netflix API GW[1]

[1] Source : http://microservices.io/patterns/apigateway.html

Page 20: WSO2 Gateway

Thank You