ICTA Meetup 12 - Message Brokers
-
Upload
crishantha-nanayakkara -
Category
Technology
-
view
175 -
download
1
description
Transcript of ICTA Meetup 12 - Message Brokers
![Page 1: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/1.jpg)
ICTA Technology Meetup 12ICTA Technology Meetup 12
By Crishantha Nanayakkara
Message Brokers
![Page 2: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/2.jpg)
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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/3.jpg)
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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/4.jpg)
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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/5.jpg)
Asynchronous – Messaging Style
![Page 6: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/6.jpg)
Asynchronous – Messaging Style
● Broadcast Oriented – All messages goes to all applications
● Pointpoint – All messages goes to one application
● Subscription based – All messages goes only to subscribers
![Page 7: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/7.jpg)
Messaging is used in distributed computing to achieve asynchronous
communication
![Page 8: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/8.jpg)
Notification and Eventing
Source: Service Oriented Architecture, Concepts, Technology and Design, Thomas Erl
![Page 9: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/9.jpg)
Publisher Subscriber Pattern
![Page 10: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/10.jpg)
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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/11.jpg)
Why Message Brokers?
![Page 12: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/12.jpg)
Using a Message Broker
![Page 13: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/13.jpg)
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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/14.jpg)
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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/15.jpg)
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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/16.jpg)
16
Advanced Message Queuing Protocol (AMQP)
![Page 17: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/17.jpg)
17
AMQP
● AMQP (Advanced Message Queuing Protocol) is an open standard and a wirelevel 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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/18.jpg)
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 interoperable, reliable, open, standardized, complete and safe
![Page 19: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/19.jpg)
19
JMS vs AMQP
● JMS has the ability to communicate with nonJava 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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/20.jpg)
Message Brokering in SOA
![Page 21: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/21.jpg)
WSEventing vs WSNotification
● There are two WS specifications to implement the publisher subscriber pattern
– WSEventing (A W3C Specification) – WSNotification (An OASIS Specification)
● Each one uses a different approach and a terminology to fulfill the “same task”
● WSEventing is more simpler and WSNotification is more detailed
![Page 22: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/22.jpg)
WSNotification(with a broker)
![Page 23: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/23.jpg)
WSNotification(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](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/24.jpg)
WSNotification compliant Message Brokers
At Alpha Stage – Developed by ICTA TT
![Page 25: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/25.jpg)
WSEventing
![Page 26: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/26.jpg)
WSEventing compliant Message Brokers
![Page 27: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/27.jpg)
The Sample Code
● https://docs.wso2.org/display/MB210/Web+Service+Client+Sample
![Page 28: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/28.jpg)
ESB Vs Message Broker
Any difference?
![Page 29: ICTA Meetup 12 - Message Brokers](https://reader033.fdocuments.us/reader033/viewer/2022052321/5559de45d8b42a34498b49a6/html5/thumbnails/29.jpg)
Questions ?