SlideShare uma empresa Scribd logo
1 de 72
The RabbitMQ Message Broker
Martin Toshev
Agenda
• Messaging Basics
• RabbitMQ Overview
• Messaging Patterns
• Administration
Agenda
• Scalability and High Availability
• Integrations
• Security
Messaging Basics
Messaging Basics
• Messaging provides a mechanism for loosely-
coupled integration of systems
• The central unit of processing in a message is a
message which typically contains a body and a
header
Messaging Basics
• Use cases include:
– Log aggregation between systems
– Event propagation between systems
– Offloading long-running tasks to worker nodes
Messaging Basics
• Messaging solutions implement different
protocols for transferring of messages such as
AMQP, XMPP, MQTT and many others
• The variety of protocols implies vendor lock-in
when using a particular messaging solution (also
called a messaging broker)
Messaging Basics
• A variety of messaging brokers can be a choice for
applications …
Messaging Basics
• Messaging solutions provide means for:
– securing message transfer, authenticating and
authorizing messaging endpoints
– routing messages between endpoints
– subscribing to the broker
Messaging Basics
• An enterprise service bus (ESB) is one layer of
abstraction above a messaging solution that further
provides:
– adapters for different for messaging protocols
– translation of messages between the different
types of protocols
RabbitMQ Overview
RabbitMQ Overview
• An open source message broker written in Erlang
• Implements the AMQP Protocol (Advanced
Message Queueing Protocol)
• Has a pluggable architecture and provides
extension for other protocols such as HTTP,
STOMP and MQTT
RabbitMQ Overview
• AMQP is a binary protocol that aims to
standardize middleware communication
• The AMQP protocol derives its origins from the
financial industry - processing of large volumes of
financial data between different systems is a
classic use case of messaging
RabbitMQ Overview
• The AMQP protocol defines:
– exchanges – the message broker endpoints that receive messages
– queues – the message broker endpoints that store messages from
exchanges and are used by subscribers for retrieval of messages
– bindings – rules that bind exchanges and queues
• The AMQP protocol is programmable – which
means that the above entities can be
created/modified/deleted by applications
RabbitMQ Overview
• The AMQP protocol defines multiple connection
channels inside a single TCP connection in order
to remove the overhead of opening a large
number of TCP connections to the message
broker
RabbitMQ Overview
Publisher
Subscriber
Subscriber
Subscriber
Publisher
exchange
exchange
queue
queue
queue
binding
binding
binding
RabbitMQ Overview
Publisher
Subscriber
Subscriber
Subscriber
Publisher
exchange
exchange
queue
queue
queue
binding
binding
binding
exchange=“xyz”
key=“abc”
payload=“bcd”
RabbitMQ Overview
• Each message can be published with a routing
key
• Each binding between an exchange and a queue
has a binding key
• Routing of messages is determined based on
matching between the routing and
binding keys
Messaging Patterns in RabbitMQ
Messaging Patterns with RabbitMQ
• Different types of messaging patterns are
implemented by means of different types of
exchanges
• RabbitMQ provides the following types of
exchanges:
– default
– direct
– fanout
– topic
– headers
Messaging Patterns with RabbitMQ
• A default exchange has the empty string as a
name and routes messages to a queue if the
routing key of the message matches the queue
name (no binding needs to be declared between
a default exchange and a queue)
• Default exchanges are suitable for point-to-point
communication between endpoints
RabbitMQ Overview
Publisher
Subscriber
Subscriber
Subscriber
Publisher
chat
log
general
error
warning
binding
exchange=“”
key=“general”
payload=“XYZ”
(AMQP
default)
(AMQP default) is a system exchange
Messaging Patterns with RabbitMQ
• A direct exchange routes messages to a queue if
the routing key of the message matches the
binding key between the direct exchange and the
queue
• Direct exchanges are suitable for point-to-point
communication between endpoints
RabbitMQ Overview
Publisher
Subscriber
Subscriber
Subscriber
Publisher
chat
log
general
error
warning
b_general
exchange=“chat”
key=“b_general”
payload=“XYZ”
(AMQP
default)
chat is defined as a direct exchange upon creation
Messaging Patterns with RabbitMQ
• A fanout exchange routes (broadcasts) messages
to all queues that are bound to it (the binding key
is not used)
• Fanout exchanges are suitable for publish-
subscribe communication between endpoints
RabbitMQ Overview
Publisher
Subscriber
Subscriber
Subscriber
Publisher
chat
log
general
error
warning
exchange=“log”
key=“”
payload=“XYZ”
(AMQP
default)
log is defined as a fanout exchange upon creation
Messaging Patterns with RabbitMQ
• A topic exchange routes (multicasts) messages to
all queues that have a binding key (can be a
pattern) that matches the routing key of the
message
• Topic exchanges are suitable for routing messages
to different queues based on the type of message
RabbitMQ Overview
Publisher
Subscriber
Subscriber
Subscriber
Publisher
chat
log
general
error
warn.server
exchange=“log”
key=“warning.#”
payload=“XYZ”
(AMQP
default)
log is defined as a topic exchange upon creation
warn.client
warning.server
warning.client
Messaging Patterns with RabbitMQ
• A headers exchange routes messages based on a
custom message header
• Header exchanges are suitable for routing
messages to different queues based on more
than one attribute
Messaging Patterns in RabbitMQ
(demo)
Administration
Administration
• Administration of the broker includes a number
of activities such as:
– updating the broker
– backing up the broker database
– Installing/uninstalling and configuring plug-ins
– configuring the various components of the broker
Administration
• Apart from queues, exchanges and bindings we
can also manage the following types of
components:
– vhosts – for logical separation of broker components
– users
– parameters (e.g. for defining upstream links to
another brokers)
– policies (e.g. for queue mirroring)
Administration
• Administration of single instance or an entire
cluster can be performed in several ways:
– using the management Web interface
– using the management HTTP API
– using the rabbitmq-admin.py script
– using the rabbitmqctl utility
Administration
(demo)
Scalability and High Availability in
RabbitMQ
• RabbitMQ provides clustering support that allows
new RabbitMQ nodes to be added on the fly
• Clustering by default does not guarantee that
message loss may not occur
Scalability and High Availability in
RabbitMQ
• Nodes in a RabbitMQ cluster can be:
– DISK – data is persisted in the node database
– RAM – data is buffered only in-memory
• Nodes share only broker metadata – messages
are not replicated among nodes
Scalability and High Availability in
RabbitMQ
• Let’s create the following three-node cluster:
Scalability and High Availability in
RabbitMQ
set RABBITMQ_NODENAME=instanceA &
set RABBITMQ_NODE_PORT=5770 &
set RABBITMQ_SERVER_START_ARGS=
-rabbitmq_management listener [{port,33333}] &
rabbitmq-server.bat –detached
• InstanceA node (root node):
Scalability and High Availability in
RabbitMQ
set RABBITMQ_NODENAME=instanceB &
set RABBITMQ_NODE_PORT=5771 &
rabbitmq-server.bat –detached
rabbitmqctl.bat –n instanceB stop_app
rabbitmqctl.bat –n instanceB join_cluster instanceA@MARTIN
rabbitmqctl.bat –n instanceB start_app
• InstanceB node (DISK node):
Scalability and High Availability in
RabbitMQ
set RABBITMQ_NODENAME=instanceC &
set RABBITMQ_NODE_PORT=5772 &
rabbitmq-server.bat –detached
rabbitmqctl.bat –n instanceC stop_app
rabbitmqctl.bat –n instanceC join_cluster –ram instanceA@MARTIN
rabbitmqctl.bat –n instanceC start_app
• InstanceC node (RAM node):
Scalability and High Availability in
RabbitMQ
• However …
• If a node that hosts a queue buffers unprocessed
messages goes down – the messages are lost
Scalability and High Availability in
RabbitMQ
• Default clustering mechanism provides scalability
in terms of queues rather than high availability
• Mirrored queues are an extension to the default
clustering mechanism that can be used to
establish high availability at the broker level
Scalability and High Availability in
RabbitMQ
• Mirrored queues provide queue replication over
different nodes that allows a message to survive
node failure
• Queue mirroring is establishing by means of a
mirroring policy that specifies:
– number of nodes to use for queue replication
– particular nodes designated by name for queue replication
– all nodes for queue replication
Scalability and High Availability in
RabbitMQ
• The node where the queue is created is the
master node – all others are slaves
• A new master node can be promoted in case the
original one goes down
• A slave node is promoted to the new master in
case it has fully synchronized with the old master
(by default)
Scalability and High Availability in
RabbitMQ
• Let’s define the test queue in the cluster and
mirror it over all other nodes:
rabbitmqadmin.py -N instanceA declare queue name=test
durable=false
rabbitmqctl -n instanceA set_policy ha-all "test" "{""ha-
mode"":""all""}"
Scalability and High Availability in
RabbitMQ
• However …
• The RabbitMQ clustering mechanism uses Erlang
message passing along with a message cookie in
order to establish communication between the
nodes
• … which is not reliable over the WAN …
Scalability and High Availability in
RabbitMQ
• In order to establish high availability among
nodes in different geographic locations you can
use the federation and shovel plug-ins
• The shovel plug-ins works at a lower level than
the federation plug-in
Scalability and High Availability in
RabbitMQ
• Assuming we have a remote node instanceD we
can make the test queue federated on that node:
Scalability and High Availability in
RabbitMQ
set RABBITMQ_NODENAME=instanceD &
set RABBITMQ_NODE_PORT=6001 &
set RABBITMQ_SERVER_START_ARGS=
-rabbitmq_management listener [{port,44444}] &
rabbitmq-server.bat –detached
rabbitmq-plugins -n instanceD enable rabbitmq_federation
rabbitmq-plugins -n instanceD enable
rabbitmq_federation_management
• Declare the remote instanceD instance and
enable the federation plug-in for it:
Scalability and High Availability in
RabbitMQ
rabbitmqadmin.py -N instanceD -P 44444 declare queue
name=federated_test durable=false
• Declare the federated_test queue:
Scalability and High Availability in
RabbitMQ
rabbitmqctl -n instanceD set_parameter federation-upstream
upstream
"{""uri"":""amqp://localhost:5770"",""expires"":3600000,
""queue"":""test""}"
rabbitmqctl -n instanceD set_policy federate-queue
--apply-to queues "federated_test"
"{""federation-upstream"":""upstream""}"
• Declare the upstream to the initial cluster and
set a federation link to the test queue:
Scalability and High Availability in
RabbitMQ
• The shovel plug-in provides two variants:
– static (all links between the source/destination
nodes/clusters) are defined statically in the RabbitMQ
configuration file
– dynamic (all links between the source/destination
nodes/clusters) are defined dynamically via RabbitMQ
parameters
Scalability and High Availability in
RabbitMQ
• The shovel plug-in provides two variants:
– static (all links between the source/destination
nodes/clusters) are defined statically in the RabbitMQ
configuration file
– dynamic (all links between the source/destination
nodes/clusters) are defined dynamically via RabbitMQ
parameters
Scalability and High Availability in
RabbitMQ
Scalability and High Availability in
RabbitMQ
(demo)
Integrations
Integrations
• RabbitMQ provides integrations with other
protocols such as STOMP, MQTT and LDAP by
means of RabbitMQ plug-ins
• The Spring Framework provides integration with
AMQP protocol and RabbitMQ in particular
Integrations
• The Spring AMQP framework provides:
– RabbitAdmin class for automatically declaring queues, exchanges and
bindings
– Listener container for asynchronous processing of inbound messages
– RabbitTemplate class for sending and receiving messages
Integrations
• Utilities of the Spring AMQP framework can used
either directly in Java or preconfigured in the
Spring configuration
• The Spring Integration framework provides
adapters for the AMQP protocol
Integrations
• The following Maven dependency can be used to
provide the Spring AMQP framework to the
application:
<dependencies>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>
</dependencies>
Integrations
• RabbitAdmin (plain Java):
CachingConnectionFactory factory = new
CachingConnectionFactory("localhost");
RabbitAdmin admin = new RabbitAdmin(factory);
Queue queue = new Queue("sample-queue");
admin.declareQueue(queue);
TopicExchange exchange = new TopicExchange("sample-topic-
exchange");
admin.declareExchange(exchange);
admin.declareBinding(BindingBuilder.bind(queue).to(exchange)
.with("sample-key"));
factory.destroy();
Integrations
• Container listener (plain Java):
CachingConnectionFactory factory =
new CachingConnectionFactory(
"localhost");
SimpleMessageListenerContainer container = new
SimpleMessageListenerContainer(
factory);
Object listener = new Object() {
public void handleMessage(String message) {
System.out.println("Message received: " +
message);
}};
MessageListenerAdapter adapter = new
MessageListenerAdapter(listener);
container.setMessageListener(adapter);
container.setQueueNames("sample-queue");
container.start();
Integrations
• RabbitTemplate (plain Java):
CachingConnectionFactory factory =
new CachingConnectionFactory("localhost");
RabbitTemplate template = new
RabbitTemplate(factory);
template.convertAndSend("", "sample-queue",
"sample-queue test message!");
Integrations
• All of the above examples can be configured
using the Spring configuration
• Must cleaner and decouples RabbitMQ
configuration for the business logic
Integrations
(demo)
Security
Security
• RabbitMQ uses SASL for authentication (SASL
PLAIN used by default)
• RabbitMQ uses access control lists (permissions)
for authorization
Security
• SSL/TLS support can be enabled for the AMQP
communication channels
• SSL/TLS support can be enabled for node
communication between nodes in a cluster
• SSL/TLS support can be enabled for the
federation and shovel plug-ins
Summary
• RabbitMQ is a robust messaging solution that can
be used in a variety of scenarios based on you
application needs
• RabbitMQ may not be the best possible solution
compared to other messaging brokers – always
consider benchmarks based on size and number
of messages
Readings
Thanks
?

Mais conteúdo relacionado

Mais procurados

Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffJAX London
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureAlvaro Videla
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging QueuesNaukri.com
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPCGuo Jing
 
Monitoring Microservices
Monitoring MicroservicesMonitoring Microservices
Monitoring MicroservicesWeaveworks
 
10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should Know10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should KnowVMware Tanzu
 
IBM MQ Clustering (2017 version)
IBM MQ Clustering (2017 version)IBM MQ Clustering (2017 version)
IBM MQ Clustering (2017 version)MarkTaylorIBM
 
What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explainedjeetendra mandal
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data IngestionAlvaro Videla
 
Spring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformVMware Tanzu
 
IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?David Ware
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservicesAnil Allewar
 

Mais procurados (20)

RabbitMQ.ppt
RabbitMQ.pptRabbitMQ.ppt
RabbitMQ.ppt
 
RabbitMq
RabbitMqRabbitMq
RabbitMq
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal Architecture
 
kafka
kafkakafka
kafka
 
A Closer Look at RabbitMQ
A Closer Look at RabbitMQA Closer Look at RabbitMQ
A Closer Look at RabbitMQ
 
IBM MQ V8 Security
IBM MQ V8 SecurityIBM MQ V8 Security
IBM MQ V8 Security
 
What is RabbitMQ ?
What is RabbitMQ ?What is RabbitMQ ?
What is RabbitMQ ?
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 
Monitoring Microservices
Monitoring MicroservicesMonitoring Microservices
Monitoring Microservices
 
10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should Know10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should Know
 
IBM MQ Clustering (2017 version)
IBM MQ Clustering (2017 version)IBM MQ Clustering (2017 version)
IBM MQ Clustering (2017 version)
 
What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explained
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
 
Spring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise Platform
 
Demystifying Service Mesh
Demystifying Service MeshDemystifying Service Mesh
Demystifying Service Mesh
 
Overview of Message Queues
Overview of Message QueuesOverview of Message Queues
Overview of Message Queues
 
IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 

Destaque

The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP Eberhard Wolff
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQJames Carr
 
Message Queue (MQ) Testing
Message Queue (MQ) TestingMessage Queue (MQ) Testing
Message Queue (MQ) TestingUjjwal Gupta
 
Parasoft Capabilities - Features
Parasoft Capabilities - FeaturesParasoft Capabilities - Features
Parasoft Capabilities - FeaturesUjjwal Gupta
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesAdam Warski
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmqSelasie Hanson
 
Security Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java PlatformSecurity Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java PlatformMartin Toshev
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Martin Toshev
 
Writing Stored Procedures with Oracle Database 12c
Writing Stored Procedures with Oracle Database 12cWriting Stored Procedures with Oracle Database 12c
Writing Stored Procedures with Oracle Database 12cMartin Toshev
 
Writing Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12cWriting Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12cMartin Toshev
 
Writing Stored Procedures in Oracle RDBMS
Writing Stored Procedures in Oracle RDBMSWriting Stored Procedures in Oracle RDBMS
Writing Stored Procedures in Oracle RDBMSMartin Toshev
 
RxJS vs RxJava: Intro
RxJS vs RxJava: IntroRxJS vs RxJava: Intro
RxJS vs RxJava: IntroMartin Toshev
 
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mqRoman Kuznietsov: Zeromq: sockets on steroids.Zero mq
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mqSphere Consulting Inc
 
KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)Martin Toshev
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQNahidul Kibria
 

Destaque (20)

The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 
Message Queue (MQ) Testing
Message Queue (MQ) TestingMessage Queue (MQ) Testing
Message Queue (MQ) Testing
 
Parasoft Capabilities - Features
Parasoft Capabilities - FeaturesParasoft Capabilities - Features
Parasoft Capabilities - Features
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queues
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmq
 
RabbitMQ Plugins Talk
RabbitMQ Plugins TalkRabbitMQ Plugins Talk
RabbitMQ Plugins Talk
 
Security Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java PlatformSecurity Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java Platform
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
 
Writing Stored Procedures with Oracle Database 12c
Writing Stored Procedures with Oracle Database 12cWriting Stored Procedures with Oracle Database 12c
Writing Stored Procedures with Oracle Database 12c
 
Introduction to Heroku Postgres
Introduction to Heroku PostgresIntroduction to Heroku Postgres
Introduction to Heroku Postgres
 
Writing Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12cWriting Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12c
 
Writing Stored Procedures in Oracle RDBMS
Writing Stored Procedures in Oracle RDBMSWriting Stored Procedures in Oracle RDBMS
Writing Stored Procedures in Oracle RDBMS
 
Modular Java
Modular JavaModular Java
Modular Java
 
RxJS vs RxJava: Intro
RxJS vs RxJava: IntroRxJS vs RxJava: Intro
RxJS vs RxJava: Intro
 
Spring RabbitMQ
Spring RabbitMQSpring RabbitMQ
Spring RabbitMQ
 
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mqRoman Kuznietsov: Zeromq: sockets on steroids.Zero mq
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
 
ZeroMQ
ZeroMQZeroMQ
ZeroMQ
 
KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
 

Semelhante a The RabbitMQ Message Broker

RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryMohammed Shaban
 
Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq mdfkhan625
 
Mule with rabbitmq
Mule with rabbitmqMule with rabbitmq
Mule with rabbitmqRajkattamuri
 
Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq javeed_mhd
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mqKhan625
 
Rabbitmq & Kafka Presentation
Rabbitmq & Kafka PresentationRabbitmq & Kafka Presentation
Rabbitmq & Kafka PresentationEmre Gündoğdu
 
Rabbit Mq in Mule
Rabbit Mq in MuleRabbit Mq in Mule
Rabbit Mq in MuleMohammed246
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mqHasan Syed
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPEberhard Wolff
 
RabbitMQ interview Questions and Answers
RabbitMQ interview Questions and AnswersRabbitMQ interview Questions and Answers
RabbitMQ interview Questions and Answersjeetendra mandal
 
Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStackSean Chang
 

Semelhante a The RabbitMQ Message Broker (20)

RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client library
 
Spring RabbitMQ
Spring RabbitMQSpring RabbitMQ
Spring RabbitMQ
 
Picking a message queue
Picking a  message queuePicking a  message queue
Picking a message queue
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
 
Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq
 
Mule with rabbitmq
Mule with rabbitmqMule with rabbitmq
Mule with rabbitmq
 
Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
Rabbitmq & Kafka Presentation
Rabbitmq & Kafka PresentationRabbitmq & Kafka Presentation
Rabbitmq & Kafka Presentation
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
Rabbit Mq in Mule
Rabbit Mq in MuleRabbit Mq in Mule
Rabbit Mq in Mule
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
Mule with rabbitmq
Mule with rabbitmqMule with rabbitmq
Mule with rabbitmq
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
RabbitMQ interview Questions and Answers
RabbitMQ interview Questions and AnswersRabbitMQ interview Questions and Answers
RabbitMQ interview Questions and Answers
 
Rabbit mq in mule
Rabbit mq in muleRabbit mq in mule
Rabbit mq in mule
 
AMQP
AMQPAMQP
AMQP
 
Mule rabbit mq
Mule rabbit mqMule rabbit mq
Mule rabbit mq
 
Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStack
 

Mais de Martin Toshev

Building highly scalable data pipelines with Apache Spark
Building highly scalable data pipelines with Apache SparkBuilding highly scalable data pipelines with Apache Spark
Building highly scalable data pipelines with Apache SparkMartin Toshev
 
Big data processing with Apache Spark and Oracle Database
Big data processing with Apache Spark and Oracle DatabaseBig data processing with Apache Spark and Oracle Database
Big data processing with Apache Spark and Oracle DatabaseMartin Toshev
 
Semantic Technology In Oracle Database 12c
Semantic Technology In Oracle Database 12cSemantic Technology In Oracle Database 12c
Semantic Technology In Oracle Database 12cMartin Toshev
 
Practical security In a modular world
Practical security In a modular worldPractical security In a modular world
Practical security In a modular worldMartin Toshev
 
Java 9 Security Enhancements in Practice
Java 9 Security Enhancements in PracticeJava 9 Security Enhancements in Practice
Java 9 Security Enhancements in PracticeMartin Toshev
 
Security Architecture of the Java platform
Security Architecture of the Java platformSecurity Architecture of the Java platform
Security Architecture of the Java platformMartin Toshev
 
Oracle Database 12c Attack Vectors
Oracle Database 12c Attack VectorsOracle Database 12c Attack Vectors
Oracle Database 12c Attack VectorsMartin Toshev
 
Concurrency Utilities in Java 8
Concurrency Utilities in Java 8Concurrency Utilities in Java 8
Concurrency Utilities in Java 8Martin Toshev
 
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)Martin Toshev
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in developmentMartin Toshev
 
java2days 2014: Attacking JavaEE Application Servers
java2days 2014: Attacking JavaEE Application Serversjava2days 2014: Attacking JavaEE Application Servers
java2days 2014: Attacking JavaEE Application ServersMartin Toshev
 
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....Martin Toshev
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8Martin Toshev
 

Mais de Martin Toshev (17)

Building highly scalable data pipelines with Apache Spark
Building highly scalable data pipelines with Apache SparkBuilding highly scalable data pipelines with Apache Spark
Building highly scalable data pipelines with Apache Spark
 
Big data processing with Apache Spark and Oracle Database
Big data processing with Apache Spark and Oracle DatabaseBig data processing with Apache Spark and Oracle Database
Big data processing with Apache Spark and Oracle Database
 
Jdk 10 sneak peek
Jdk 10 sneak peekJdk 10 sneak peek
Jdk 10 sneak peek
 
Semantic Technology In Oracle Database 12c
Semantic Technology In Oracle Database 12cSemantic Technology In Oracle Database 12c
Semantic Technology In Oracle Database 12c
 
Practical security In a modular world
Practical security In a modular worldPractical security In a modular world
Practical security In a modular world
 
Java 9 Security Enhancements in Practice
Java 9 Security Enhancements in PracticeJava 9 Security Enhancements in Practice
Java 9 Security Enhancements in Practice
 
Java 9 sneak peek
Java 9 sneak peekJava 9 sneak peek
Java 9 sneak peek
 
Security Architecture of the Java platform
Security Architecture of the Java platformSecurity Architecture of the Java platform
Security Architecture of the Java platform
 
Oracle Database 12c Attack Vectors
Oracle Database 12c Attack VectorsOracle Database 12c Attack Vectors
Oracle Database 12c Attack Vectors
 
JVM++: The Graal VM
JVM++: The Graal VMJVM++: The Graal VM
JVM++: The Graal VM
 
Concurrency Utilities in Java 8
Concurrency Utilities in Java 8Concurrency Utilities in Java 8
Concurrency Utilities in Java 8
 
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
java2days 2014: Attacking JavaEE Application Servers
java2days 2014: Attacking JavaEE Application Serversjava2days 2014: Attacking JavaEE Application Servers
java2days 2014: Attacking JavaEE Application Servers
 
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

The RabbitMQ Message Broker

  • 1. The RabbitMQ Message Broker Martin Toshev
  • 2. Agenda • Messaging Basics • RabbitMQ Overview • Messaging Patterns • Administration
  • 3. Agenda • Scalability and High Availability • Integrations • Security
  • 5. Messaging Basics • Messaging provides a mechanism for loosely- coupled integration of systems • The central unit of processing in a message is a message which typically contains a body and a header
  • 6. Messaging Basics • Use cases include: – Log aggregation between systems – Event propagation between systems – Offloading long-running tasks to worker nodes
  • 7. Messaging Basics • Messaging solutions implement different protocols for transferring of messages such as AMQP, XMPP, MQTT and many others • The variety of protocols implies vendor lock-in when using a particular messaging solution (also called a messaging broker)
  • 8. Messaging Basics • A variety of messaging brokers can be a choice for applications …
  • 9. Messaging Basics • Messaging solutions provide means for: – securing message transfer, authenticating and authorizing messaging endpoints – routing messages between endpoints – subscribing to the broker
  • 10. Messaging Basics • An enterprise service bus (ESB) is one layer of abstraction above a messaging solution that further provides: – adapters for different for messaging protocols – translation of messages between the different types of protocols
  • 12. RabbitMQ Overview • An open source message broker written in Erlang • Implements the AMQP Protocol (Advanced Message Queueing Protocol) • Has a pluggable architecture and provides extension for other protocols such as HTTP, STOMP and MQTT
  • 13. RabbitMQ Overview • AMQP is a binary protocol that aims to standardize middleware communication • The AMQP protocol derives its origins from the financial industry - processing of large volumes of financial data between different systems is a classic use case of messaging
  • 14. RabbitMQ Overview • The AMQP protocol defines: – exchanges – the message broker endpoints that receive messages – queues – the message broker endpoints that store messages from exchanges and are used by subscribers for retrieval of messages – bindings – rules that bind exchanges and queues • The AMQP protocol is programmable – which means that the above entities can be created/modified/deleted by applications
  • 15. RabbitMQ Overview • The AMQP protocol defines multiple connection channels inside a single TCP connection in order to remove the overhead of opening a large number of TCP connections to the message broker
  • 18. RabbitMQ Overview • Each message can be published with a routing key • Each binding between an exchange and a queue has a binding key • Routing of messages is determined based on matching between the routing and binding keys
  • 20. Messaging Patterns with RabbitMQ • Different types of messaging patterns are implemented by means of different types of exchanges • RabbitMQ provides the following types of exchanges: – default – direct – fanout – topic – headers
  • 21. Messaging Patterns with RabbitMQ • A default exchange has the empty string as a name and routes messages to a queue if the routing key of the message matches the queue name (no binding needs to be declared between a default exchange and a queue) • Default exchanges are suitable for point-to-point communication between endpoints
  • 23. Messaging Patterns with RabbitMQ • A direct exchange routes messages to a queue if the routing key of the message matches the binding key between the direct exchange and the queue • Direct exchanges are suitable for point-to-point communication between endpoints
  • 25. Messaging Patterns with RabbitMQ • A fanout exchange routes (broadcasts) messages to all queues that are bound to it (the binding key is not used) • Fanout exchanges are suitable for publish- subscribe communication between endpoints
  • 27. Messaging Patterns with RabbitMQ • A topic exchange routes (multicasts) messages to all queues that have a binding key (can be a pattern) that matches the routing key of the message • Topic exchanges are suitable for routing messages to different queues based on the type of message
  • 29. Messaging Patterns with RabbitMQ • A headers exchange routes messages based on a custom message header • Header exchanges are suitable for routing messages to different queues based on more than one attribute
  • 30. Messaging Patterns in RabbitMQ (demo)
  • 32. Administration • Administration of the broker includes a number of activities such as: – updating the broker – backing up the broker database – Installing/uninstalling and configuring plug-ins – configuring the various components of the broker
  • 33. Administration • Apart from queues, exchanges and bindings we can also manage the following types of components: – vhosts – for logical separation of broker components – users – parameters (e.g. for defining upstream links to another brokers) – policies (e.g. for queue mirroring)
  • 34. Administration • Administration of single instance or an entire cluster can be performed in several ways: – using the management Web interface – using the management HTTP API – using the rabbitmq-admin.py script – using the rabbitmqctl utility
  • 36. Scalability and High Availability in RabbitMQ • RabbitMQ provides clustering support that allows new RabbitMQ nodes to be added on the fly • Clustering by default does not guarantee that message loss may not occur
  • 37. Scalability and High Availability in RabbitMQ • Nodes in a RabbitMQ cluster can be: – DISK – data is persisted in the node database – RAM – data is buffered only in-memory • Nodes share only broker metadata – messages are not replicated among nodes
  • 38. Scalability and High Availability in RabbitMQ • Let’s create the following three-node cluster:
  • 39. Scalability and High Availability in RabbitMQ set RABBITMQ_NODENAME=instanceA & set RABBITMQ_NODE_PORT=5770 & set RABBITMQ_SERVER_START_ARGS= -rabbitmq_management listener [{port,33333}] & rabbitmq-server.bat –detached • InstanceA node (root node):
  • 40. Scalability and High Availability in RabbitMQ set RABBITMQ_NODENAME=instanceB & set RABBITMQ_NODE_PORT=5771 & rabbitmq-server.bat –detached rabbitmqctl.bat –n instanceB stop_app rabbitmqctl.bat –n instanceB join_cluster instanceA@MARTIN rabbitmqctl.bat –n instanceB start_app • InstanceB node (DISK node):
  • 41. Scalability and High Availability in RabbitMQ set RABBITMQ_NODENAME=instanceC & set RABBITMQ_NODE_PORT=5772 & rabbitmq-server.bat –detached rabbitmqctl.bat –n instanceC stop_app rabbitmqctl.bat –n instanceC join_cluster –ram instanceA@MARTIN rabbitmqctl.bat –n instanceC start_app • InstanceC node (RAM node):
  • 42. Scalability and High Availability in RabbitMQ • However … • If a node that hosts a queue buffers unprocessed messages goes down – the messages are lost
  • 43. Scalability and High Availability in RabbitMQ • Default clustering mechanism provides scalability in terms of queues rather than high availability • Mirrored queues are an extension to the default clustering mechanism that can be used to establish high availability at the broker level
  • 44. Scalability and High Availability in RabbitMQ • Mirrored queues provide queue replication over different nodes that allows a message to survive node failure • Queue mirroring is establishing by means of a mirroring policy that specifies: – number of nodes to use for queue replication – particular nodes designated by name for queue replication – all nodes for queue replication
  • 45. Scalability and High Availability in RabbitMQ • The node where the queue is created is the master node – all others are slaves • A new master node can be promoted in case the original one goes down • A slave node is promoted to the new master in case it has fully synchronized with the old master (by default)
  • 46. Scalability and High Availability in RabbitMQ • Let’s define the test queue in the cluster and mirror it over all other nodes: rabbitmqadmin.py -N instanceA declare queue name=test durable=false rabbitmqctl -n instanceA set_policy ha-all "test" "{""ha- mode"":""all""}"
  • 47. Scalability and High Availability in RabbitMQ • However … • The RabbitMQ clustering mechanism uses Erlang message passing along with a message cookie in order to establish communication between the nodes • … which is not reliable over the WAN …
  • 48. Scalability and High Availability in RabbitMQ • In order to establish high availability among nodes in different geographic locations you can use the federation and shovel plug-ins • The shovel plug-ins works at a lower level than the federation plug-in
  • 49. Scalability and High Availability in RabbitMQ • Assuming we have a remote node instanceD we can make the test queue federated on that node:
  • 50. Scalability and High Availability in RabbitMQ set RABBITMQ_NODENAME=instanceD & set RABBITMQ_NODE_PORT=6001 & set RABBITMQ_SERVER_START_ARGS= -rabbitmq_management listener [{port,44444}] & rabbitmq-server.bat –detached rabbitmq-plugins -n instanceD enable rabbitmq_federation rabbitmq-plugins -n instanceD enable rabbitmq_federation_management • Declare the remote instanceD instance and enable the federation plug-in for it:
  • 51. Scalability and High Availability in RabbitMQ rabbitmqadmin.py -N instanceD -P 44444 declare queue name=federated_test durable=false • Declare the federated_test queue:
  • 52. Scalability and High Availability in RabbitMQ rabbitmqctl -n instanceD set_parameter federation-upstream upstream "{""uri"":""amqp://localhost:5770"",""expires"":3600000, ""queue"":""test""}" rabbitmqctl -n instanceD set_policy federate-queue --apply-to queues "federated_test" "{""federation-upstream"":""upstream""}" • Declare the upstream to the initial cluster and set a federation link to the test queue:
  • 53. Scalability and High Availability in RabbitMQ • The shovel plug-in provides two variants: – static (all links between the source/destination nodes/clusters) are defined statically in the RabbitMQ configuration file – dynamic (all links between the source/destination nodes/clusters) are defined dynamically via RabbitMQ parameters
  • 54. Scalability and High Availability in RabbitMQ • The shovel plug-in provides two variants: – static (all links between the source/destination nodes/clusters) are defined statically in the RabbitMQ configuration file – dynamic (all links between the source/destination nodes/clusters) are defined dynamically via RabbitMQ parameters
  • 55. Scalability and High Availability in RabbitMQ
  • 56. Scalability and High Availability in RabbitMQ (demo)
  • 58. Integrations • RabbitMQ provides integrations with other protocols such as STOMP, MQTT and LDAP by means of RabbitMQ plug-ins • The Spring Framework provides integration with AMQP protocol and RabbitMQ in particular
  • 59. Integrations • The Spring AMQP framework provides: – RabbitAdmin class for automatically declaring queues, exchanges and bindings – Listener container for asynchronous processing of inbound messages – RabbitTemplate class for sending and receiving messages
  • 60. Integrations • Utilities of the Spring AMQP framework can used either directly in Java or preconfigured in the Spring configuration • The Spring Integration framework provides adapters for the AMQP protocol
  • 61. Integrations • The following Maven dependency can be used to provide the Spring AMQP framework to the application: <dependencies> <dependency> <groupId>org.springframework.amqp</groupId> <artifactId>spring-rabbit</artifactId> <version>1.4.5.RELEASE</version> </dependency> </dependencies>
  • 62. Integrations • RabbitAdmin (plain Java): CachingConnectionFactory factory = new CachingConnectionFactory("localhost"); RabbitAdmin admin = new RabbitAdmin(factory); Queue queue = new Queue("sample-queue"); admin.declareQueue(queue); TopicExchange exchange = new TopicExchange("sample-topic- exchange"); admin.declareExchange(exchange); admin.declareBinding(BindingBuilder.bind(queue).to(exchange) .with("sample-key")); factory.destroy();
  • 63. Integrations • Container listener (plain Java): CachingConnectionFactory factory = new CachingConnectionFactory( "localhost"); SimpleMessageListenerContainer container = new SimpleMessageListenerContainer( factory); Object listener = new Object() { public void handleMessage(String message) { System.out.println("Message received: " + message); }}; MessageListenerAdapter adapter = new MessageListenerAdapter(listener); container.setMessageListener(adapter); container.setQueueNames("sample-queue"); container.start();
  • 64. Integrations • RabbitTemplate (plain Java): CachingConnectionFactory factory = new CachingConnectionFactory("localhost"); RabbitTemplate template = new RabbitTemplate(factory); template.convertAndSend("", "sample-queue", "sample-queue test message!");
  • 65. Integrations • All of the above examples can be configured using the Spring configuration • Must cleaner and decouples RabbitMQ configuration for the business logic
  • 68. Security • RabbitMQ uses SASL for authentication (SASL PLAIN used by default) • RabbitMQ uses access control lists (permissions) for authorization
  • 69. Security • SSL/TLS support can be enabled for the AMQP communication channels • SSL/TLS support can be enabled for node communication between nodes in a cluster • SSL/TLS support can be enabled for the federation and shovel plug-ins
  • 70. Summary • RabbitMQ is a robust messaging solution that can be used in a variety of scenarios based on you application needs • RabbitMQ may not be the best possible solution compared to other messaging brokers – always consider benchmarks based on size and number of messages