rabbitmq and easynetq
DESCRIPTION
Presentation given to the Hampton Roads .NET Users Group January 2013TRANSCRIPT
RabbitMQ and EasyNetQ
Ken Taylor (@taylorka)reQuire LLC
“Messaging that just works”
RabbitMQ: Who, What?
• Developed by SpringSource • Written in Erlang• Message Broker (MOM)• Advanced Message Queuing Protocol
(AMQP)
RabbitMQ: Who, What?
• NASA NEBULA Cloud Computing• AMQP Sponsors–Microsoft–Bank of America–JPMorgan Chase–Et. Al.
RabbitMQ: Why?
• Distributed• Asynchronous• Easy to use• Highly fault tolerant
RabbitMQ: Why?
"The world is concurrent. Things in the world don't share data. Things communicate with messages. Things fail.“
- Joe Armstrong
RabbitMQ: The Basics
• Exchanges• Queues• Routing• Channels• Virtual Hosts
Mailbox, Postman & Post office
Exchange Types
• Direct• Fanout• Topic• Headers
Direct Exchange
Headers exchange routing
• Ignores routing key• Headers attributes used for routing• Can bind a queue using one or more headers• Can route on other values– Integer – Hash/Dictionary– Others
Topic exchange routing
• Routing to 1 or more queues– Message routing key– Pattern for queue binding
• Multicast Routing• Consumers choose message to receive
Queues
• Store messages• Consumed by applications• Have properties– Durable– Exclusive– Auto-delete
• Declared before use
Channels & Virtual Hosts
• Channels– Lightweight connections that share a single TCP
connection• Virtual Hosts– Allows broker to host multiple environments– Similar to virtual hosts on IIS
EasyNetQ: Who, What?
• Open source (easynetq.com)• Written by Mike Hadlow– github.com/mikehadlow
• NuGet Package• Sponsored by 15below.com
EasyNetQ: Who, What?
• Simple .NET API• Opinionated Implementation– Trades flexibility for simplicity
• Simple conventions– Messages should be represented by .NET types. – Messages should be routed by their .NET type.
EasyNetQ: Why?
• Easy to install• Less code• Serializes to JSON• Simple conventions
DEMO
How can I use it today?
• Download Erlang OTP– Erlang.org
• Download RabbitMQ– Rabbitmq.com
• Install EasyNetQ with NuGet– “Install-Package EasyNetQ”
Questions?
• Important Links– Rabbitmq.com– Erlang.org– EasyNetq.com
• About Me– Ken Taylor (Twitter @taylorka)– Switchspan.com