Enterprise Messaging

Report 6 Downloads 177 Views
Decouple & Scale with Enterprise Messaging

WHO AM I? •

Luis Majano - Computer Engineer



Born in El Salvador ------------------>



Architecture + Software Design



CEO of Ortus Solutions



Manager of the IECFUG (www.iecfug.com)



Adobe Community Professional



Creator of all things Box: 
 ColdBox, ContentBox, WireBox....

AGENDA



RPC Calls



What is Messaging



Implementations



AMQP Protocol



RabbitMQ



Nice Demo

RPC STYLE CALLS CFC

CFC

CFC

PROBLEMS WITH RPC



Blocks Request Usage



Even if you do them Asynchronous, messages only 1 receiver



Sender always knows about receiver



Receiver knows about sender



How can we decouple knowledge?



How can we apply messaging patterns to our apps?

Messaging (EMS) Doesn’t care about consumers

Producer

Can be any system or language Does not get a response

Asynchronous

Messaging Bus Can be any system or language

Consumer

Consumer

Consumer

BENEFITS OF MESSAGING •

Producers don’t care about consumers -> Decouple



Cross platforms-technologies-OS, you name it -> Flexibility



Event Driven Programming -> Scalability



Queueing for later delivery



Asynchronous



Load balancing



Hulkyfied services

Usages and Patterns Messaging

Publish/Subscribe

Work Queues

Topics/Routing

Protocols

JMS

AMQP

STOMP

AMQP - www.amqp.org •

Advanced Message Queuing Protocol



!= JMS



Standard binary protocol



Exchanges



Queuing



Routing



Reliable



Secure



Several Implementations

RabbitMQ ActiveMQ Qpid StormMQ



AMQP Messaging Broker



www.rabbitmq.com



Built on erlang like Couchbase NoSQL



Extremely fast, reliable and secure



Languages: c#, erlang, java, python, ruby, node, etc



Simple concept



Accepts and forwards messages



Its like a post box, post office and postman

HOW IT WORKS? Routing key = Bindings

Producer

Body = binary, json, anything

Message

(Body+Routing Key)

Exchange (Bindings via Routing Key)

Queues

stock.
 prices

stock.
 run

log.
 error

cluster

Queues are bound to exchanges with patterns

EXCHANGE TYPES •





Direct •

Routing key = queue name



No mapping or extra fluff just a passthrough



Similar to JMS

Topic •

Binding pattern (routing key) is match against the queue name



Not full regex



Ex: log.*, log#



Not like JMS Topics, forget JMS, this is not JMS

Fanout + More

LOAD BALANCING + ACK Consumer

Worker Queue

Messages are round-robin to each consumer

Consumer

Consumer need to ack Consumer

PUB-SUB EXAMPLE



Java Producer



Java Consumer



CFML Consumer



NodeJS Consumer



JavaScript Consumer



CFML Producer

DEMO TIME

Q&A •

RabbitMQ In Action Book



http://www.rabbitmq.com



http://tryrabbitmq.com/



https://github.com/RabbitMQSimulator/RabbitMQSimulator



http://koo.fi/blog/2013/02/18/web-messaging-with-rabbitmq-web-stomp-andsockjs/



https://github.com/robharrop/presentations.git