icta meetup 12 - message brokers

29
ICTA Technology Meetup 12 ICTA Technology Meetup 12 By Crishantha Nanayakkara Message Brokers

Upload: crishantha-nanayakkara

Post on 18-May-2015

175 views

Category:

Technology


1 download

DESCRIPTION

This is about Message Brokers. It covers the concepts, specifications, open standards and the current implementations in the area of Message Brokers

TRANSCRIPT

Page 1: ICTA Meetup 12 - Message Brokers

ICTA Technology Meetup 12ICTA Technology Meetup 12

By Crishantha Nanayakkara

Message Brokers

Page 2: ICTA Meetup 12 - Message Brokers

Service Invocation

● Synchronous– The consumer uses a single thread to invoke 

the service. The thread sends the request, blocks it until it gets the response from the service

● Asynchronous– The consumer uses a pair of threads to invoke 

the service. The first thread sends the request and releases itself. The second thread gets the response from the service once it completes its task.

Page 3: ICTA Meetup 12 - Message Brokers

Synchronous – RPC Style

● The predominant approach– RMI, SOAP / REST Web Services, CORBA

● Request/Response pattern– Calls remote methods and waits for the 

response● Problems

– Tight coupling– What about network failures or long latencies?

Page 4: ICTA Meetup 12 - Message Brokers

Asynchronous – Messaging Style

● Decoupled● Reliable

– Message can be stored and forwarded– Redelivery until the message processed

● Solves typical problems of distributed systems– Network Failures – Network Latency issues

Page 5: ICTA Meetup 12 - Message Brokers

Asynchronous – Messaging Style

Page 6: ICTA Meetup 12 - Message Brokers

Asynchronous – Messaging Style

● Broadcast Oriented – All messages goes to all applications

● Point­point – All messages goes to one application

● Subscription based – All messages goes only to subscribers 

Page 7: ICTA Meetup 12 - Message Brokers

Messaging is used in distributed computing to achieve asynchronous 

communication

Page 8: ICTA Meetup 12 - Message Brokers

Notification and Eventing

Source: Service Oriented Architecture, Concepts, Technology and Design, Thomas Erl

Page 9: ICTA Meetup 12 - Message Brokers

Publisher Subscriber Pattern

Page 10: ICTA Meetup 12 - Message Brokers

Publisher Subscriber Pattern

● This involves a publisher service that makes information categorized by different topics for registered subscribers. 

● Subscribers can select which that they are willing to subscribe by interacting directly with a publisher. 

● Here, When a new piece of information on a given topic is available, the publisher broadcasts this information to all those subscribers/ services that have subscribed to that topic.

Page 11: ICTA Meetup 12 - Message Brokers

Why Message Brokers?

Page 12: ICTA Meetup 12 - Message Brokers

Using a Message Broker

Page 13: ICTA Meetup 12 - Message Brokers

Using a Message Broker

● A message broker can be used to perform the broadcast on the publishers’ behalf. 

● Reduce the dependency between the publisher and the subscriber allowing it for a complete decoupled architecture. 

● Provides the much required flexibility and the scalability.

Page 14: ICTA Meetup 12 - Message Brokers

14

Message Broker Standards and Implementations

● The Message Broker protocols / standards:– JMS (A Java standard)

– MSMQ (.NET implementation)

– AMQP (An open standard)

● Implementations:– Apache ActiveMQ (JMS)

– .NET WCF (MSMQ)

– RabbitMQ (AMQP)

– Apache Qpid (AMQP)

– ZeroMQ (AMQP)

Page 15: ICTA Meetup 12 - Message Brokers

15

JMS

● JMS  is  a  Java  API  that  allows  applications  to create, send, receive and read messages.

● JMS  API  defines  a  common  set  of  interfaces and  associated  semantics  that  allow programs written  in  Java  to  communicate  with  other messaging implementations.

Page 16: ICTA Meetup 12 - Message Brokers

16

Advanced Message Queuing Protocol (AMQP)

Page 17: ICTA Meetup 12 - Message Brokers

17

AMQP

● AMQP (Advanced Message Queuing Protocol) is an open standard and a wire­level protocol, which is designed to support messaging on the Internet.

● AMQP is the only open standard available so far for the cross platform interoperability between heterogeneous messaging systems and message brokers. 

Page 18: ICTA Meetup 12 - Message Brokers

18

AMQP

● For example, Java Message Producer (JMS Client) can send message to a .NET/C# consumer with the help of a AMQP Message Broker

● it is inter­operable, reliable, open, standardized, complete and safe 

Page 19: ICTA Meetup 12 - Message Brokers

19

JMS vs AMQP

● JMS has the ability to communicate with non­Java platforms like Ruby by using Message Bridges. But this is a bit of a complex situation in the Enterprise level Integration.

● The industry is using AMQP to get rid of this complexity

Page 20: ICTA Meetup 12 - Message Brokers

Message Brokering in SOA

Page 21: ICTA Meetup 12 - Message Brokers

WS­Eventing vs WS­Notification

● There are two WS specifications  to implement the publisher subscriber pattern

– WS­Eventing (A W3C Specification) – WS­Notification (An OASIS Specification)

● Each one uses a different approach and a terminology to fulfill the “same task”

● WS­Eventing is more simpler and WS­Notification is more detailed

Page 22: ICTA Meetup 12 - Message Brokers

WS­Notification(with a broker)

Page 23: ICTA Meetup 12 - Message Brokers

WS­Notification(with a broker)

● The Notification Broker (Web Service) – Acts on behalf of the publisher to perform the role of the Notification Producer.

● The Publisher Registration Manager (Web Service) – This provides an interface for subscribers to search through and locate items available for registration

● The Subscription Manager (Web Service) – This allows notification producers to access and retrieve required subscriber information for a given notification message broadcast.

Page 24: ICTA Meetup 12 - Message Brokers

WS­Notification compliant Message Brokers

At Alpha Stage – Developed by ICTA TT

Page 25: ICTA Meetup 12 - Message Brokers

WS­Eventing

Page 26: ICTA Meetup 12 - Message Brokers

WS­Eventing compliant Message Brokers

Page 27: ICTA Meetup 12 - Message Brokers

The Sample Code

● https://docs.wso2.org/display/MB210/Web+Service+Client+Sample

Page 28: ICTA Meetup 12 - Message Brokers

ESB Vs Message Broker

Any difference?

Page 29: ICTA Meetup 12 - Message Brokers

Questions ?