Post on 24-Jan-2015
description
MESSAGING SYSTEMS
WHY SHOULD I USE THEM?
http://slidesha.re/1dwZ1eS
!
• @hannelita
• Software Developer
• Coffee and Pokémon Addicted
Hanneli
Hi!
http://slidesha.re/1dwZ1eS
What we will see
• How can we integrate 2 or more systems?
• A list of alternatives to integrate them
• Problems and good points of these strategies
• Messaging systems - the good parts
• Messaging systems - the bad points
• Cool pictures, stupid jokes and funny gifs
(or not that funny)http://slidesha.re/1dwZ1eS
Software development - very simple
http://slidesha.re/1dwZ1eS
Simple software development
Web!
1. Number of users increases
2. Number of requested functionalities increases
How can we expand the system?
How can we integrate?
Hi!@&ˆ!@!
???????
How can we integrate?
The systems need to change information.
Method 1
Hi!
Method 1 - TXT
Method 1 - TXT
• How should I format the TXT file?
• Parse == Hell
• Speed (development and execution)
Method 1 - TXT
Method 1I
Hi!
ESB
Hello!
Method 1I - ESB
Method 1I - ESB
• SOA Expertise
• High skill set
• $$$$$ in some cases.
Method I1 - ESB
One example
Support Company
Example
PLZ FIX MY SYSTEM.
Sure! I will contact IT department.
Sales Guy
Example
Heeeyy IT guy! Yo!We have work to
do!
Example
Have you seen the hockey game yesterday?
YEEESS AWESOME!
bla bla bla bla bla bla
Example
bla bla bla
bla bla bla
Example
Synchronous communication
Example
Have you seen the hockey game yesterday?
YEEESS AWESOME!
Example
The SHALL NOT directly communicate.
Example
Client 1 Request 1
Example
Now they won’t directly communicate!
Example
Asynchronous Communication
They don’t waste time!
Example
Some problems
Some Problems
Message Transmission
Asynchronous communication
No direct communication
There’s a ‘keeper' for the message board
M essageOrientedM iddleware
Message Transmission
Destination
Message
Sender ReceiverBroker
More Technical
Sender ReceiverBroker
Java World
M essageOrientedM iddleware
J avaMessageS ervice
Specification(PDF)
ActiveMQHornetQ
Oracle AQ
Some implementations
Implementations
HornetQ
ActiveMQ
- Work with different languages
(interoperability)
- Security (Cryptography)
- Message delivery guarantee (Reliability)
PROTOCOL
A vancedM essageQ ueuingP rotocol
Implementations
HornetQ
ActiveMQ
- Work with different languages
(interoperability)
- Similar to HTTP
- Text
PROTOCOL
S treamingTextO rientedM essageP rotocol
Implementations
ØMQ{- Multiple Languages
- Concurrency
- Transports messages between protocols
- Multicast
- Written in C++
- Performance
- Hard to configure
Implementatiosn
Sidekiq{ - Ruby
- Rails
- Redis
- Performance
Implementations
Kafka{- Performance
- Scalability
- Messages persisted on disk and replicated on
cluster
- Environment had to configure
Implementations
ActiveMQ{- Performance
- Java
- ESBs
When I should use messaging systems
Asynchronous communication
- Email{ - Reports
- Long running operations in batch
When I should NOT use messaging systems
Synchronous communication
- Requires immediate response{ - Cannot provide
information about the destination
MOAR Examples
Imagine a system:
Sends Emails
CRUD Generates Daily Reports
Captures and log eventsJMS
JMS
JMS
Before Messaging Systems
doSomething();
doMOAR();
sadsdsda();
return();
Synchronous communicationWhat happens if
it takes too long?
Queue
Consumer
After Messaging Systems
return();
Asynchronous communication
sendMessageToQueue();
doSomething();
doMOAR();
sadsdsda();
All done for this message!
Where to go now
Enterprise Integration Patterns
Apache Camel
JMS
References
• http://academictech.doit.wisc.edu/blend/facilitate/communicate
• http://docs.oracle.com/cd/E19340-01/820-6424/aeraq/index.html
• http://docs.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html
• http://www.practicingsafetechs.com/TechsV1/MOMs/
• http://www.amqp.org/product/overview
• http://stomp.github.io/stomp-specification-1.2.html#Protocol_Overview
• http://zguide.zeromq.org/
• https://github.com/mperham/sidekiq/wiki
• http://kafka.apache.org/