WSO2Con USA 2017: Journey of Migration from Legacy ESB to Modern WSO2 ESB Platform
Resilient Enterprise Messaging with WSO2 ESB
-
Upload
ravindra-ranwala -
Category
Engineering
-
view
63 -
download
1
Transcript of Resilient Enterprise Messaging with WSO2 ESB
![Page 1: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/1.jpg)
Resilient Enterprise Messaging with WSO2 ESB
Isuru UdanaAssociate Technical Lead
Ravindra RanwalaSoftware Engineer
June 2015
![Page 2: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/2.jpg)
About the Presenters
๏ Isuru Udana Associate Technical Lead WSO2
๏ Ravindra Ranwala Software Engineer WSO2
![Page 3: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/3.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/5.jpg)
Role of the ESB
Service Integration
![Page 6: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/6.jpg)
Spaghetti IntegrationWhat about maintainability, scalability, troubleshooting and governance?
Role of the ESB
![Page 7: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/7.jpg)
Role of the ESB
ESB in Action
![Page 8: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/8.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/9.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/10.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/11.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/12.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/13.jpg)
Role of the Message Broker
● Enhance Reliability■ Persistence■ Transactions
● Decoupling■ Space■ Time■ Synchronization
![Page 14: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/14.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/15.jpg)
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 TerminologyMessage 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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/16.jpg)
Use cases
![Page 17: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/17.jpg)
Integrating Systems with ESB using a Message Broker Important Feature: Protocol Switching in ESB
![Page 18: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/18.jpg)
Integrating Systems with ESB using a Message Broker Case 01: ESB as a JMS Consumer
![Page 19: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/19.jpg)
Integrating Systems with ESB using a Message Broker ESB as a JMS Producer
![Page 20: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/20.jpg)
Integrating Systems with ESB using a Message Broker ESB as Both a JMS Producer and Consumer
![Page 21: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/21.jpg)
Integrating Systems with ESB using a Message Broker JMS Synchronous Invocations
![Page 22: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/22.jpg)
Integrating Systems with ESB using a Message Broker Store and Forward - Guaranteed Delivery
![Page 23: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/23.jpg)
Integrating Systems with ESB using a Message Broker Store and Forward - Guaranteed Delivery
![Page 24: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/24.jpg)
Integrating Systems with ESB using a Message Broker Store and Forward - Request Rate Matching
![Page 25: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/25.jpg)
Integrating Systems with ESB using a Message Broker Store and Forward - In-order Delivery
![Page 26: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/26.jpg)
Introduction to WSO2 ESB
![Page 27: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/27.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/28.jpg)
Key Features - Routing
![Page 29: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/29.jpg)
Key Features - Filtering
![Page 30: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/30.jpg)
Key Features - Transformation
![Page 31: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/31.jpg)
Key Features - Protocol Switch
![Page 32: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/32.jpg)
Key Features - Load Balancing
![Page 33: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/33.jpg)
Key Features - Quality of Service
![Page 34: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/34.jpg)
Introduction to WSO2 MB
![Page 35: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/35.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/36.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/37.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/38.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/39.jpg)
Clustered Message Broker
![Page 40: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/40.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/41.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/42.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/43.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/44.jpg)
Implementing Use Cases with WSO2 ESB and WSO2 MB
![Page 45: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/45.jpg)
Implementing Use cases ESB as a JMS Consumer
![Page 46: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/46.jpg)
ESB as a JMS Consumer
![Page 47: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/47.jpg)
Implementing Use cases ESB as a JMS Producer
![Page 48: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/48.jpg)
ESB as a JMS Producer
![Page 49: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/49.jpg)
Implementing Use cases ESB as Both a JMS Producer and Consumer
![Page 50: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/50.jpg)
ESB as Both a JMS Producer and Consumer
![Page 51: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/51.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/52.jpg)
Implementing Use cases Store and forward in clustered environments
![Page 53: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/53.jpg)
*
Demo
![Page 54: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/54.jpg)
*
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/55.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/56.jpg)
QnA
![Page 57: Resilient Enterprise Messaging with WSO2 ESB](https://reader036.fdocuments.in/reader036/viewer/2022062302/58ef69e81a28ab80278b45d1/html5/thumbnails/57.jpg)
Contact us !