Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering RabbitMQ

You're reading from   Mastering RabbitMQ Master the art of developing message-based applications with RabbitMQ

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781783981526
Length 286 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
 Ayanoglu Ayanoglu
Author Profile Icon Ayanoglu
Ayanoglu
Yusuf Aytas Yusuf Aytas
Author Profile Icon Yusuf Aytas
Yusuf Aytas
 Nahum Nahum
Author Profile Icon Nahum
Nahum
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Getting Started 2. Configuring RabbitMQ FREE CHAPTER 3. Architecture and Messaging 4. Clustering and High Availability 5. Plugins and Plugin Development 6. Managing Your RabbitMQ Server 7. Monitoring 8. Security in RabbitMQ 9. Java RabbitMQ Client Programming 10. Ruby Client Programming 11. Python Client Programming Index

Using Bunny


Let's continue by building a sanity-level consumer and producer just to test things out.

Bunny producer

We will first have a taste of what a log aggregator producer looks like:

require "bunny"

conn = Bunny.new
conn.start

channel = conn.create_channel
queue = channel.queue("clicks")

channel.default_exchange.publish('{ "message":"hello" }', :routing_key => queue.name)
puts "* sent!"

conn.close

We start inquiring about Bunny so that we have access to the Bunny API. We then initialize a Bunny instance, start a connection for the purpose of getting a reach at an AMQP channel, and then through the channel, we declare a queue and get access to an exchange.

We use the default exchange for simplicity, which was accessed through the channel we just got. We publish through a routing key that incidentally (or not) has the same name as the queue in order to autoroute the message to that queue.

We send a message that looks like JSON, but this is just a hint at what's about to come; for all...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering RabbitMQ
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon