57
Resilient Enterprise Messaging with WSO2 ESB Isuru Udana Associate Technical Lead Ravindra Ranwala Software Engineer June 2015

Resilient Enterprise Messaging with WSO2 ESB

  • Upload
    wso2

  • View
    409

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Resilient Enterprise Messaging with WSO2 ESB

Resilient Enterprise Messaging with WSO2 ESB

Isuru UdanaAssociate Technical Lead

Ravindra RanwalaSoftware Engineer

June 2015

Page 2: Resilient Enterprise Messaging with WSO2 ESB

About the Presenters

๏ Isuru Udana Associate Technical Lead WSO2

๏ Ravindra Ranwala Software Engineer WSO2

Page 3: Resilient Enterprise Messaging with WSO2 ESB

Outline● Role of the ESB in enterprise service integration● Role of the message broker in enterprise service integration● Use cases

○ ESB as a JMS provider○ ESB as a JMS consumer○ Guaranteed delivery with store and forward○ Request rate matching○ In-order Delivery○ Store and forward in clustered environments

● Introduction to WSO2 ESB● Introduction to WSO2 Message Broker● Integrating WSO2 MB with WSO2 ESB● Implementing Use cases● New enhancements in ESB 4.9.0 for JMS messaging use cases ● Demo● Q & A

Page 4: Resilient Enterprise Messaging with WSO2 ESB

Role of the ESB in Enterprise Service IntegrationModern Enterprises

● Comprised of so many systems and services

● Built based on open standards, custom built, acquired from a third party, part of a legacy system or any combination of these.

Integration

● Organizations are moving away from MONOLITHIC systems.

● Multiple systems connected with SOA as the blueprint.

Page 5: Resilient Enterprise Messaging with WSO2 ESB

Role of the ESB

Service Integration

Page 6: Resilient Enterprise Messaging with WSO2 ESB

Spaghetti IntegrationWhat about maintainability, scalability, troubleshooting and governance?

Role of the ESB

Page 7: Resilient Enterprise Messaging with WSO2 ESB

Role of the ESB

ESB in Action

Page 8: Resilient Enterprise Messaging with WSO2 ESB

What is an ESB?

●An ESB is a middleware solution that enables interoperability, among heterogeneous environments using a service oriented model. ●Stateless and Seamless Integration

●Standard protocols/formats like SOAP, REST, JSON

●Transports like HTTP/S, JMS, TCP, VFS (and many more)

Page 9: Resilient Enterprise Messaging with WSO2 ESB

Role of the Message Broker in Enterprise Service Integration

●Messaging enables distributed communication that is loosely coupled ●Messaging agent / Message broker stay in the middle

●Senders send messages and the broker delivers them to recipients

●Message sender does not know about receiver neither receiver knows about sender

●Sender/Receiver should know :■Message format■Destination

Page 10: Resilient Enterprise Messaging with WSO2 ESB

Role of the Message Broker

Messaging Models

● Point to Point (Queues)○ A message is delivered only

once to a single recipient

● Publish/Subscribe (Topics)○ Broadcast a message to all

the subscribers

Page 11: Resilient Enterprise Messaging with WSO2 ESB

Queues

● A queue is a destination that contains messages sent from a producer that await delivery to one consumer.

● Messages are delivered in the sent order.● A message is removed from the queue once it has been acknowledged

as received by the consumer.

Page 12: Resilient Enterprise Messaging with WSO2 ESB

Topics

● Topics are used to send messages to one or more consumers. Producers publish messages to a topic and each consumer subscribed to the topic receives a copy of message

● Brokers matches events (messages) and delivers to all interested parties

Page 13: Resilient Enterprise Messaging with WSO2 ESB

Role of the Message Broker

● Enhance Reliability■ Persistence■ Transactions

● Decoupling■ Space■ Time■ Synchronization

Page 14: Resilient Enterprise Messaging with WSO2 ESB

Integrating an ESB and a Message Broker

Java Message Service (JMS)

● A specification that define a standard API for java programmer to perform messaging by interacting with a message broker

● It does not define the message format or how java API interacts with the message broker

● Enables communication that is○ Loosely coupled○ Asynchronous - JMS provider can deliver messages as they

arrive, client does not have to request messages.○ Reliable - The JMS API ensures that a message is delivered

once and only once

Page 15: Resilient Enterprise Messaging with WSO2 ESB

dest = (Destination) jndiContext.lookup(destName);

queue = (Queue) jndiContext.lookup(queueName);MessageProducer producer = session.createProducer(dest);TextMessage message = session.createTextMessage();message.setText(“Hello”);producer.send(message);

JMS Terminology

Message Producer, Consumer and Broker

Message Producer

Message Consumer

Message Broker

dest = (Destination) jndiContext.lookup(destName);

queue = (Queue) jndiContext.lookup(queueName);MessageConsumer consumer = session.createConsumer(dest);Message m = consumer.receive();

Page 16: Resilient Enterprise Messaging with WSO2 ESB

Use cases

Page 17: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

Important Feature: Protocol Switching in ESB

Page 18: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

Case 01: ESB as a JMS Consumer

Page 19: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

ESB as a JMS Producer

Page 20: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

ESB as Both a JMS Producer and Consumer

Page 21: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

JMS Synchronous Invocations

Page 22: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

Store and Forward - Guaranteed Delivery

Page 23: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

Store and Forward - Guaranteed Delivery

Page 24: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

Store and Forward - Request Rate Matching

Page 25: Resilient Enterprise Messaging with WSO2 ESB

Integrating Systems with ESB using a Message Broker

Store and Forward - In-order Delivery

Page 26: Resilient Enterprise Messaging with WSO2 ESB

Introduction to WSO2 ESB

Page 27: Resilient Enterprise Messaging with WSO2 ESB

WSO2 ESB

• A lightweight, high performance ESB

• Feature rich and standards compliant

• SOAP and WS-* standards

• REST support

• Domain specific protocol support (eg: FIX, HL7)

• User friendly and highly extensible

• 100% free and open source with commercial support

Page 28: Resilient Enterprise Messaging with WSO2 ESB

Key Features - Routing

Page 29: Resilient Enterprise Messaging with WSO2 ESB

Key Features - Filtering

Page 30: Resilient Enterprise Messaging with WSO2 ESB

Key Features - Transformation

Page 31: Resilient Enterprise Messaging with WSO2 ESB

Key Features - Protocol Switch

Page 32: Resilient Enterprise Messaging with WSO2 ESB

Key Features - Load Balancing

Page 33: Resilient Enterprise Messaging with WSO2 ESB

Key Features - Quality of Service

Page 34: Resilient Enterprise Messaging with WSO2 ESB

Introduction to WSO2 MB

Page 35: Resilient Enterprise Messaging with WSO2 ESB

WSO2 Message Broker

Unique distributable, fault tolerant and scalable enterprise message broker to connect, persist and reliably distribute data, event

information generated from multiple systems, applications and IoT devices.

Page 36: Resilient Enterprise Messaging with WSO2 ESB

Supported Protocols & Specification

● Implements and supports JMS API using AMQP

● JMS(Java Message Service)● Standard Java API for programmers to handle messaging by

interacting with a message

● AMQP(Advanced Message Queue Protocol)

● Open Standard for passing business messages between applications or organizations

● MQTT(Message Queue Telemetry Transport)● Lightweight pub-sub protocol designed for IoT.

Page 37: Resilient Enterprise Messaging with WSO2 ESB

Advantages

● Integrate easily with existing IT Infrastructure .

● Select storage based on messaging demands .

● Provides option between strict and best effort message delivery.

● Low maintenance through minimum deployment effort.

● Highly interoperable with AMQP clients.

● Effortlessly handle large message transfer.● Seamless feature integration with WSO2 ESB.

Page 38: Resilient Enterprise Messaging with WSO2 ESB

AMQP, JMS and WSO2 MB● JMS (Java Message Service)

○ A specification that define a standard API for java programmer to perform messaging by interacting with a message broker

○ It does not define the message format or how java API interacts with the message broker

● AMQP (Advanced Message Queuing Protocol)○ Open standard for passing business messages between

applications or organizations.○ AMQP let different systems (e.g. .NET and Java) to interact with

each other by agreeing on the message format at the wire level just like Web Services.

● WSO2 MB (Broker)○ Implements and supports JMS API using AMQP protocol

for messaging (All the same, we are not limited to JMS)

Page 39: Resilient Enterprise Messaging with WSO2 ESB

Clustered Message Broker

Page 40: Resilient Enterprise Messaging with WSO2 ESB

How WSO2 MB is Different● Pluggable Message storage

○ RDBMS as the storage - (Tested for MySQL, Oracle, MSSQL, H2)○ Apache Cassandra as the storage

■ NoSQL Highly scalable data model with Very high write throughput and good read throughput

● Scaling – WSO2 MB can be clustered adding nodes to meet business requirements.○ Nodes can be dynamically added and removed

● Distributed coordination middleware○ HazelCast - Scalable, fault tolerant distributed coordination

framework

Page 41: Resilient Enterprise Messaging with WSO2 ESB

Why WSO2 MB is Different● Failover with no message lost – Clustering + Failover capability

brings this feature● Ability to handle large message transfers in real time

○ As Cassandra is one of our storage, messages are written fast to store and we create only one copy of message while delivery

● High Availability and Fault Tolerance○ No single point of failure with MB cluster + Cassandra cluster.

All nodes are vertically and horizontally scalable. Cassandra keep replicates of messages.

● Interoperability with many languages / platforms via AMQP/MQTT clients for Java, .Net, C, C++, PHP, Ruby, Erlang and more

Page 42: Resilient Enterprise Messaging with WSO2 ESB

Integrating WSO2 ESB with WSO2 MB● Setting up WSO2 Message Broker

○ Download and install WSO2 MB○ Apply port offset in <MB_HOME>/repository/conf/carbon.xml file○ Start the Message Broker

Page 43: Resilient Enterprise Messaging with WSO2 ESB

Integrating WSO2 ESB with WSO2 MB● Setting up WSO2 ESB

○ Download and install WSO2 ESB binary distribution○ Enable the JMS transport of WSO2 ESB to communicate with the

Message Broker by editing $ESB_HOME/repository/conf/axis2/axis2.xml file

○ Copy the following jar files from <MB_HOME>/clent-lib folder to <ESB_HOME>/repository/components/lib folder. andes-client-0.13.wso2v4, geronimo-jms_1.1_spec-1.1.0.wso2v1

○ Open <ESB_HOME>/repository/conf/ JNDI.proerties file and point to the running Message Broker.

○ Start WSO2 ESB by running <ESB_HOME>/bin/wso2server.sh

Page 44: Resilient Enterprise Messaging with WSO2 ESB

Implementing Use Cases with WSO2 ESB and WSO2 MB

Page 45: Resilient Enterprise Messaging with WSO2 ESB

Implementing Use cases

ESB as a JMS Consumer

Page 46: Resilient Enterprise Messaging with WSO2 ESB

ESB as a JMS Consumer

Page 47: Resilient Enterprise Messaging with WSO2 ESB

Implementing Use cases

ESB as a JMS Producer

Page 48: Resilient Enterprise Messaging with WSO2 ESB

ESB as a JMS Producer

Page 49: Resilient Enterprise Messaging with WSO2 ESB

Implementing Use cases ESB as Both a JMS Producer and Consumer

Page 50: Resilient Enterprise Messaging with WSO2 ESB

ESB as Both a JMS Producer and Consumer

Page 51: Resilient Enterprise Messaging with WSO2 ESB

Implementing Use cases Store and Forward

● Asynchronous/One-way Messaging, JMS

● Guaranteed Delivery and Rate matching

● JMS Message broker as the persistence store – WSO2 MB, Apache

Active MQ etc.

Page 52: Resilient Enterprise Messaging with WSO2 ESB

Implementing Use cases Store and forward in clustered environments

Page 53: Resilient Enterprise Messaging with WSO2 ESB

*

Demo

Page 54: Resilient Enterprise Messaging with WSO2 ESB

*

New Enhancements in ESB 4.9.0 for JMS messaging use cases ● Message Store/Processor coordination support

○ Message Processor is backed by one or more Task(s)○ Message Processor executes only in worker nodes○ Message Processor never gets executed in manager node○ One Message Processor can be represented by multiple tasks

running on multiple worker nodes given the member count value○ Message Processor states are synchronized across the nodes in

the cluster● JMS Inbound Endpoints

○ Create JMS Listeners dynamically without changing axis2.xml and server restart

○ Support JMS protocol in tenants○ Distributed coordination

■Run in all/one node

Page 55: Resilient Enterprise Messaging with WSO2 ESB

Where to begin..

● ESB Documentation https://docs.wso2.org/display/ESB481/WSO2+Enterprise+Service+Bus+Documentation

● MB Documentationhttps://docs.wso2.com/display/MB210/WSO2+Message+Broker+Documentation

Page 56: Resilient Enterprise Messaging with WSO2 ESB

QnA

Page 57: Resilient Enterprise Messaging with WSO2 ESB

Contact us !