confoo 2014 messaging systems

53
MESSAGING SYSTEMS WHY SHOULD I USE THEM? http://slidesha.re/1dwZ1eS

Upload: hanneli-tavante

Post on 24-Jan-2015

343 views

Category:

Technology


0 download

DESCRIPTION

Confoo 2014 talk - Messaging systems - why should I use them?

TRANSCRIPT

Page 1: Confoo 2014 Messaging Systems

MESSAGING SYSTEMS

WHY SHOULD I USE THEM?

http://slidesha.re/1dwZ1eS

Page 2: Confoo 2014 Messaging Systems

!

• @hannelita

• Software Developer

• Coffee and Pokémon Addicted

Hanneli

Hi!

http://slidesha.re/1dwZ1eS

Page 3: Confoo 2014 Messaging Systems

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

Page 4: Confoo 2014 Messaging Systems

Software development - very simple

http://slidesha.re/1dwZ1eS

Page 5: Confoo 2014 Messaging Systems

Simple software development

Web!

Page 6: Confoo 2014 Messaging Systems

1. Number of users increases

Page 7: Confoo 2014 Messaging Systems

2. Number of requested functionalities increases

Page 8: Confoo 2014 Messaging Systems

How can we expand the system?

Page 9: Confoo 2014 Messaging Systems

How can we integrate?

Hi!@&ˆ!@!

???????

Page 10: Confoo 2014 Messaging Systems

How can we integrate?

The systems need to change information.

Page 11: Confoo 2014 Messaging Systems

Method 1

Hi!

Page 12: Confoo 2014 Messaging Systems

Method 1 - TXT

Page 13: Confoo 2014 Messaging Systems

Method 1 - TXT

• How should I format the TXT file?

• Parse == Hell

• Speed (development and execution)

Page 14: Confoo 2014 Messaging Systems

Method 1 - TXT

Page 15: Confoo 2014 Messaging Systems

Method 1I

Hi!

ESB

Hello!

Page 16: Confoo 2014 Messaging Systems

Method 1I - ESB

Page 17: Confoo 2014 Messaging Systems

Method 1I - ESB

• SOA Expertise

• High skill set

• $$$$$ in some cases.

Page 18: Confoo 2014 Messaging Systems

Method I1 - ESB

Page 19: Confoo 2014 Messaging Systems

One example

Support Company

Page 20: Confoo 2014 Messaging Systems

Example

PLZ FIX MY SYSTEM.

Sure! I will contact IT department.

Sales Guy

Page 21: Confoo 2014 Messaging Systems

Example

Heeeyy IT guy! Yo!We have work to

do!

Page 22: Confoo 2014 Messaging Systems

Example

Have you seen the hockey game yesterday?

YEEESS AWESOME!

Page 23: Confoo 2014 Messaging Systems

bla bla bla bla bla bla

Page 24: Confoo 2014 Messaging Systems

Example

bla bla bla

bla bla bla

Page 25: Confoo 2014 Messaging Systems

Example

Synchronous communication

Page 26: Confoo 2014 Messaging Systems

Example

Have you seen the hockey game yesterday?

YEEESS AWESOME!

Page 27: Confoo 2014 Messaging Systems

Example

The SHALL NOT directly communicate.

Page 28: Confoo 2014 Messaging Systems

Example

Client 1 Request 1

Page 29: Confoo 2014 Messaging Systems

Example

Now they won’t directly communicate!

Page 30: Confoo 2014 Messaging Systems

Example

Asynchronous Communication

They don’t waste time!

Page 31: Confoo 2014 Messaging Systems

Example

Page 32: Confoo 2014 Messaging Systems
Page 33: Confoo 2014 Messaging Systems

Some problems

Page 34: Confoo 2014 Messaging Systems
Page 35: Confoo 2014 Messaging Systems

Some Problems

Page 36: Confoo 2014 Messaging Systems

Message Transmission

Asynchronous communication

No direct communication

There’s a ‘keeper' for the message board

M essageOrientedM iddleware

Page 37: Confoo 2014 Messaging Systems

Message Transmission

Destination

Message

Sender ReceiverBroker

Page 38: Confoo 2014 Messaging Systems

More Technical

Sender ReceiverBroker

Page 39: Confoo 2014 Messaging Systems

Java World

M essageOrientedM iddleware

J avaMessageS ervice

Specification(PDF)

ActiveMQHornetQ

Oracle AQ

Some implementations

Page 40: Confoo 2014 Messaging Systems

Implementations

HornetQ

ActiveMQ

- Work with different languages

(interoperability)

- Security (Cryptography)

- Message delivery guarantee (Reliability)

PROTOCOL

A vancedM essageQ ueuingP rotocol

Page 41: Confoo 2014 Messaging Systems

Implementations

HornetQ

ActiveMQ

- Work with different languages

(interoperability)

- Similar to HTTP

- Text

PROTOCOL

S treamingTextO rientedM essageP rotocol

Page 42: Confoo 2014 Messaging Systems

Implementations

ØMQ{- Multiple Languages

- Concurrency

- Transports messages between protocols

- Multicast

- Written in C++

- Performance

- Hard to configure

Page 43: Confoo 2014 Messaging Systems

Implementatiosn

Sidekiq{ - Ruby

- Rails

- Redis

- Performance

Page 44: Confoo 2014 Messaging Systems

Implementations

Kafka{- Performance

- Scalability

- Messages persisted on disk and replicated on

cluster

- Environment had to configure

Page 45: Confoo 2014 Messaging Systems

Implementations

ActiveMQ{- Performance

- Java

- ESBs

Page 46: Confoo 2014 Messaging Systems

When I should use messaging systems

Asynchronous communication

- Email{ - Reports

- Long running operations in batch

Page 47: Confoo 2014 Messaging Systems

When I should NOT use messaging systems

Synchronous communication

- Requires immediate response{ - Cannot provide

information about the destination

Page 48: Confoo 2014 Messaging Systems

MOAR Examples

Imagine a system:

Sends Emails

CRUD Generates Daily Reports

Captures and log eventsJMS

JMS

JMS

Page 49: Confoo 2014 Messaging Systems

Before Messaging Systems

doSomething();

doMOAR();

sadsdsda();

return();

Synchronous communicationWhat happens if

it takes too long?

Page 50: Confoo 2014 Messaging Systems

Queue

Consumer

After Messaging Systems

return();

Asynchronous communication

sendMessageToQueue();

doSomething();

doMOAR();

sadsdsda();

All done for this message!

Page 51: Confoo 2014 Messaging Systems

Where to go now

Enterprise Integration Patterns

Apache Camel

JMS

Page 52: Confoo 2014 Messaging Systems

Questions?

[email protected]!Twitter: @hannelita

THANK YOU!

Page 53: Confoo 2014 Messaging Systems

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/