Top Banner
RabbitMQ and EasyNetQ Ken Taylor (@taylorka) reQuire LLC “Messaging that just works”
22

RabbitMQ and EasyNetQ

May 10, 2015

Download

Technology

Ken Taylor

Presentation given to the Hampton Roads .NET Users Group January 2013
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: RabbitMQ and EasyNetQ

RabbitMQ and EasyNetQ

Ken Taylor (@taylorka)reQuire LLC

“Messaging that just works”

Page 2: RabbitMQ and EasyNetQ
Page 3: RabbitMQ and EasyNetQ

RabbitMQ: Who, What?

• Developed by SpringSource • Written in Erlang• Message Broker (MOM)• Advanced Message Queuing Protocol

(AMQP)

Page 4: RabbitMQ and EasyNetQ

RabbitMQ: Who, What?

• NASA NEBULA Cloud Computing• AMQP Sponsors–Microsoft–Bank of America–JPMorgan Chase–Et. Al.

Page 5: RabbitMQ and EasyNetQ
Page 6: RabbitMQ and EasyNetQ

RabbitMQ: Why?

• Distributed• Asynchronous• Easy to use• Highly fault tolerant

Page 7: RabbitMQ and EasyNetQ

RabbitMQ: Why?

"The world is concurrent. Things in the world don't share data. Things communicate with messages. Things fail.“

- Joe Armstrong

Page 8: RabbitMQ and EasyNetQ

RabbitMQ: The Basics

• Exchanges• Queues• Routing• Channels• Virtual Hosts

Page 9: RabbitMQ and EasyNetQ

Mailbox, Postman & Post office

Page 10: RabbitMQ and EasyNetQ

Exchange Types

• Direct• Fanout• Topic• Headers

Page 11: RabbitMQ and EasyNetQ

Direct Exchange

Page 12: RabbitMQ and EasyNetQ
Page 13: RabbitMQ and EasyNetQ

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

Page 14: RabbitMQ and EasyNetQ

Topic exchange routing

• Routing to 1 or more queues– Message routing key– Pattern for queue binding

• Multicast Routing• Consumers choose message to receive

Page 15: RabbitMQ and EasyNetQ

Queues

• Store messages• Consumed by applications• Have properties– Durable– Exclusive– Auto-delete

• Declared before use

Page 16: RabbitMQ and EasyNetQ

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

Page 17: RabbitMQ and EasyNetQ

EasyNetQ: Who, What?

• Open source (easynetq.com)• Written by Mike Hadlow– github.com/mikehadlow

• NuGet Package• Sponsored by 15below.com

Page 18: RabbitMQ and EasyNetQ

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.

Page 19: RabbitMQ and EasyNetQ

EasyNetQ: Why?

• Easy to install• Less code• Serializes to JSON• Simple conventions

DEMO

Page 20: RabbitMQ and EasyNetQ

How can I use it today?

• Download Erlang OTP– Erlang.org

• Download RabbitMQ– Rabbitmq.com

• Install EasyNetQ with NuGet– “Install-Package EasyNetQ”

Page 21: RabbitMQ and EasyNetQ
Page 22: RabbitMQ and EasyNetQ

Questions?

• Important Links– Rabbitmq.com– Erlang.org– EasyNetq.com

• About Me– Ken Taylor (Twitter @taylorka)– Switchspan.com