Upload
wso2
View
409
Download
0
Tags:
Embed Size (px)
Citation preview
Resilient Enterprise Messaging with WSO2 ESB
Isuru UdanaAssociate Technical Lead
Ravindra RanwalaSoftware Engineer
June 2015
About the Presenters
๏ Isuru Udana Associate Technical Lead WSO2
๏ Ravindra Ranwala Software Engineer WSO2
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
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.
Role of the ESB
Service Integration
Spaghetti IntegrationWhat about maintainability, scalability, troubleshooting and governance?
Role of the ESB
Role of the ESB
ESB in Action
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)
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
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
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.
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
Role of the Message Broker
● Enhance Reliability■ Persistence■ Transactions
● Decoupling■ Space■ Time■ Synchronization
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
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();
Use cases
Integrating Systems with ESB using a Message Broker
Important Feature: Protocol Switching in ESB
Integrating Systems with ESB using a Message Broker
Case 01: ESB as a JMS Consumer
Integrating Systems with ESB using a Message Broker
ESB as a JMS Producer
Integrating Systems with ESB using a Message Broker
ESB as Both a JMS Producer and Consumer
Integrating Systems with ESB using a Message Broker
JMS Synchronous Invocations
Integrating Systems with ESB using a Message Broker
Store and Forward - Guaranteed Delivery
Integrating Systems with ESB using a Message Broker
Store and Forward - Guaranteed Delivery
Integrating Systems with ESB using a Message Broker
Store and Forward - Request Rate Matching
Integrating Systems with ESB using a Message Broker
Store and Forward - In-order Delivery
Introduction to 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
Key Features - Routing
Key Features - Filtering
Key Features - Transformation
Key Features - Protocol Switch
Key Features - Load Balancing
Key Features - Quality of Service
Introduction to WSO2 MB
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.
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.
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.
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)
Clustered Message Broker
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
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
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
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
Implementing Use Cases with WSO2 ESB and WSO2 MB
Implementing Use cases
ESB as a JMS Consumer
ESB as a JMS Consumer
Implementing Use cases
ESB as a JMS Producer
ESB as a JMS Producer
Implementing Use cases ESB as Both a JMS Producer and Consumer
ESB as Both a JMS Producer and Consumer
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.
Implementing Use cases Store and forward in clustered environments
*
Demo
*
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
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
QnA
Contact us !