SlideShare a Scribd company logo
1 of 30
Java Messaging with
AMQP and RabbitMQ
или “JMS, давай до-свидания”
1
The big picture
2
3
Async Java World
Servlets 3.0 - async requests Servlets 3.1 - nio
Netty ReactiveX (RxJava)
Vert.xJAX-RSSpring MVC
Play Framework Akka
4
Messaging Protocols
AMQP
MQTT
STOMP
0-9-1 1-0
JMS
SMTP, POP3, IMAP
XMPP
DDS
5
Protocols comparison
6
AMQP facts
Wire Protocol
Родился в 2006 in J.P.Morgan (миллиарды сообщений в
день)
Миссия: интеграция сообщений между платформами
Поддерживается в Apache Camel, Spring Integration, Mule,..
7
AMQP is the Internet Protocol for Business
Messaging
versions:
1.0 - Now International standard:
ISO/IEC 19464:2014, OASIS (2014)
RabbitMQ supports version 1.0 via plugin
0-10, 0-9-1, 0-9, 0-8
1.0:
Not declaring broker architecture, broker management
commands. Symmetric.
8
9
Frames
Frame structure:
Sending content:
Content Header:
10
One Million Messages Per Second on Google
31 nodes, 8 virtual CPUs on each, 248 cores total
(2014, https://blog.pivotal.io/pivotal/products/rabbitmq-hits-one-million-messages-per-second-on-google-
compute-engine
11
JMS
AMQP
12
Exchange
Direct Fanout Topic Headers
Types:
Features:
• Durability (survive broker restart)
• Auto-delete (deleted when all queues have finished using it)
Default Exchange
13
14
15
Topic Exchange
* (star) can substitute for exactly one word.
# (hash) can substitute for zero or more words.
16
More Exchange Types
• Headers - по заголовкам сообщения “x-
match”=“any”/“all”
• Dead Letter Exchange (для недоставленных
сообщений)
• Constant-Hash (plugin)
• Delayed Exchange ( задержки перед отправкой)
• more …
17
Queues
• FIFO (soft)
• Durable / in-memory
• Exclusive
• Auto-delete
• Arguments (TTL,…)
18
Consumers
• Rule: One message goes to one consumer, unless redelivery
happens
• Serial per Channel (thread)
• Pull / Subscribe API
• Send acknowledgements (ack)
• can do “auto-ack” ( hits reliability )
• round robin with optional priorities
19
20
21
Что у кролика внутри
Erlang
• создан в Ericsson для телеком-железа
• functional
• lightweight processes
• good scaling over CPU
• deadlocks-aware design
• communication between network-distributed processes
• Live code upgrade
• Built in Process Monitoring and Control
22
Concurrency
23
Spring
@Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory cf = new CachingConnectionFactory("localhost");
cf.setUsername("guest");
cf.setPassword("guest");
return cf;
}
@Bean
public AmqpAdmin amqpAdmin() {
return new RabbitAdmin(connectionFactory());
}
@Bean
public RabbitTemplate rabbitTemplate() {
RabbitTemplate template = new RabbitTemplate(connectionFactory());
// Отправлять сюда
template.setRoutingKey(this.helloWorldQueueName);
// Чиать отсюда
template.setQueue(this.helloWorldQueueName);
return template;
}
24
Spring async consume
@Bean
public SimpleMessageListenerContainer listenerContainer() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory());
container.setQueueNames(this.helloWorldQueueName);
container.setMessageListener(new MessageListenerAdapter(new HelloWorldHandler()));
return container;
}
Sync:
AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
System.out.println("Received: " + amqpTemplate.receiveAndConvert());
25
Spring: ListenerContainer
AbstractMessageListenerContainer
private volatile Object messageListener;
private volatile AcknowledgeMode acknowledgeMode = AcknowledgeMode.AUTO;
private MessageConverter messageConverter;
private ErrorHandler errorHandler = new ConditionalRejectingErrorHandler();
…
SimpleMessageListenerContainer
private volatile Executor taskExecutor = new SimpleAsyncTaskExecutor();
private volatile int concurrentConsumers = 1;
private volatile Integer maxConcurrentConsumers;
private volatile boolean exclusive;
private volatile int prefetchCount = DEFAULT_PREFETCH_COUNT; // 1
…
26
RabbitTemplate
currently, the only implementation of AMQPTemplate
Methods:
send(Message m, …), convertAndSend(Object o , …) …
recieve(): Message, recieveAndConvert(…), recieveAndReply(…) …
sendAndRecieve(…), convertSendAndRecieve(), …
Features:
• Retry and recovery (spring-retry)
• Publisher confirms and returns (ReturnCallback, ConfirmCallback)
• Message PostProcessors - after receive and before publish (zip/unzip, …)
27
Finally, AMQP vs JMS
JMS
Standard API
Native to Java world
Enterprizzy
AMQP
Truly Cross - platform
Comprehensive Topology
More Tuning (?)
Some Readings:
“Understanding the differences between AMQP and JMS”
http://www.wmrichards.com/amqp.pdf
Why Erlang is good for AMQP implementation
https://pubs.vmware.com/vfabric5/index.jsp#com.vmware.vfabric.rabbitmq.2.4/erlang.html
Alvaro Videla’s presentation “RabbitMQ Internal Architecture”
http://www.slideshare.net/old_sound/dissecting-the-rabbit
All About Messaging Protocols. What Are the Differences? by Bryon Moyer
http://www.eejournal.com/archives/articles/20150420-protocols/
Whats wrong with AMQP and how to fix it
http://www.imatix.com/articles:whats-wrong-with-amqp/
Messaging Products performance comparison
https://softwaremill.com/mqperf/
Thanks
Sincerely Yours,
Maxim Konovalov
BPC Banking Technologies, Runet Business Systems
https://www.facebook.com/maxim.konovalov.1

More Related Content

What's hot

The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message BrokerMartin Toshev
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQPOSSCON
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQAll Things Open
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging QueuesNaukri.com
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQPvoluntas
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinRabbitMQ Summit
 
A walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda DubeA walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda DubeRabbitMQ Summit
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPEberhard Wolff
 
Distributed messaging with AMQP
Distributed messaging with AMQPDistributed messaging with AMQP
Distributed messaging with AMQPWee Keat Chin
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQGavin Roy
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQKnoldus Inc.
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmqSelasie Hanson
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepthWee Keat Chin
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQNahidul Kibria
 

What's hot (20)

AMQP with RabbitMQ
AMQP with RabbitMQAMQP with RabbitMQ
AMQP with RabbitMQ
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
 
RabbitMQ & Hutch
RabbitMQ & HutchRabbitMQ & Hutch
RabbitMQ & Hutch
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
AMQP for phpMelb
AMQP for phpMelbAMQP for phpMelb
AMQP for phpMelb
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQP
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael Klishin
 
A walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda DubeA walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda Dube
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
Spring RabbitMQ
Spring RabbitMQSpring RabbitMQ
Spring RabbitMQ
 
Distributed messaging with AMQP
Distributed messaging with AMQPDistributed messaging with AMQP
Distributed messaging with AMQP
 
Amqp Basic
Amqp BasicAmqp Basic
Amqp Basic
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQ
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 
A Closer Look at RabbitMQ
A Closer Look at RabbitMQA Closer Look at RabbitMQ
A Closer Look at RabbitMQ
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmq
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
 

Viewers also liked

HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009jarfield
 
Web sphere mq Online Training at bigclasses
Web sphere mq Online Training at bigclassesWeb sphere mq Online Training at bigclasses
Web sphere mq Online Training at bigclassesBigClasses.com
 
Interoperability With RabbitMq
Interoperability With RabbitMqInteroperability With RabbitMq
Interoperability With RabbitMqAlvaro Videla
 
RabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft ConfRabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft ConfAlvaro Videla
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questionspraveen_guda
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data IngestionAlvaro Videla
 
IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction ejlp12
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesEberhard Wolff
 

Viewers also liked (9)

Differences between JMS and AMQP
Differences between JMS and AMQPDifferences between JMS and AMQP
Differences between JMS and AMQP
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009
 
Web sphere mq Online Training at bigclasses
Web sphere mq Online Training at bigclassesWeb sphere mq Online Training at bigclasses
Web sphere mq Online Training at bigclasses
 
Interoperability With RabbitMq
Interoperability With RabbitMqInteroperability With RabbitMq
Interoperability With RabbitMq
 
RabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft ConfRabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft Conf
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questions
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
 
IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction IBM WebSphere MQ Introduction
IBM WebSphere MQ Introduction
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
 

Similar to Java Messaging with AMQP and RabbitMQ

Chicago Kafka Meetup
Chicago Kafka MeetupChicago Kafka Meetup
Chicago Kafka MeetupCliff Gilmore
 
quickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmqquickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmqjorgesimao71
 
Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...Jaap ter Woerds
 
Building scalable network applications with Netty
Building scalable network applications with NettyBuilding scalable network applications with Netty
Building scalable network applications with NettyNLJUG
 
Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!Guido Schmutz
 
LLVM-based Communication Optimizations for PGAS Programs
LLVM-based Communication Optimizations for PGAS ProgramsLLVM-based Communication Optimizations for PGAS Programs
LLVM-based Communication Optimizations for PGAS ProgramsAkihiro Hayashi
 
Apache Kafka
Apache KafkaApache Kafka
Apache KafkaJoe Stein
 
Flink Streaming Hadoop Summit San Jose
Flink Streaming Hadoop Summit San JoseFlink Streaming Hadoop Summit San Jose
Flink Streaming Hadoop Summit San JoseKostas Tzoumas
 
Apache Flink(tm) - A Next-Generation Stream Processor
Apache Flink(tm) - A Next-Generation Stream ProcessorApache Flink(tm) - A Next-Generation Stream Processor
Apache Flink(tm) - A Next-Generation Stream ProcessorAljoscha Krettek
 
Down the RabbitMQ Hole
Down the RabbitMQ HoleDown the RabbitMQ Hole
Down the RabbitMQ HoleBizTalk360
 
Flexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkFlexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkDataWorks Summit
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageDamien Dallimore
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikEdgar Espina
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka StreamsGuozhang Wang
 
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantImplementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantShixiong Shang
 
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
 
Dataservices: Processing Big Data the Microservice Way
Dataservices: Processing Big Data the Microservice WayDataservices: Processing Big Data the Microservice Way
Dataservices: Processing Big Data the Microservice WayQAware GmbH
 
Messaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQMessaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQdejanb
 

Similar to Java Messaging with AMQP and RabbitMQ (20)

EIP In Practice
EIP In PracticeEIP In Practice
EIP In Practice
 
Chicago Kafka Meetup
Chicago Kafka MeetupChicago Kafka Meetup
Chicago Kafka Meetup
 
quickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmqquickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmq
 
Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...
 
Building scalable network applications with Netty
Building scalable network applications with NettyBuilding scalable network applications with Netty
Building scalable network applications with Netty
 
Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!
 
LLVM-based Communication Optimizations for PGAS Programs
LLVM-based Communication Optimizations for PGAS ProgramsLLVM-based Communication Optimizations for PGAS Programs
LLVM-based Communication Optimizations for PGAS Programs
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Flink Streaming Hadoop Summit San Jose
Flink Streaming Hadoop Summit San JoseFlink Streaming Hadoop Summit San Jose
Flink Streaming Hadoop Summit San Jose
 
Apache Flink(tm) - A Next-Generation Stream Processor
Apache Flink(tm) - A Next-Generation Stream ProcessorApache Flink(tm) - A Next-Generation Stream Processor
Apache Flink(tm) - A Next-Generation Stream Processor
 
Down the RabbitMQ Hole
Down the RabbitMQ HoleDown the RabbitMQ Hole
Down the RabbitMQ Hole
 
Flexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkFlexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache Flink
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the message
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip Hanik
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka Streams
 
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantImplementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
 
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
 
Dataservices: Processing Big Data the Microservice Way
Dataservices: Processing Big Data the Microservice WayDataservices: Processing Big Data the Microservice Way
Dataservices: Processing Big Data the Microservice Way
 
Messaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQMessaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQ
 

Recently uploaded

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 

Recently uploaded (20)

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 

Java Messaging with AMQP and RabbitMQ

  • 1. Java Messaging with AMQP and RabbitMQ или “JMS, давай до-свидания” 1
  • 3. 3
  • 4. Async Java World Servlets 3.0 - async requests Servlets 3.1 - nio Netty ReactiveX (RxJava) Vert.xJAX-RSSpring MVC Play Framework Akka 4
  • 7. AMQP facts Wire Protocol Родился в 2006 in J.P.Morgan (миллиарды сообщений в день) Миссия: интеграция сообщений между платформами Поддерживается в Apache Camel, Spring Integration, Mule,.. 7
  • 8. AMQP is the Internet Protocol for Business Messaging versions: 1.0 - Now International standard: ISO/IEC 19464:2014, OASIS (2014) RabbitMQ supports version 1.0 via plugin 0-10, 0-9-1, 0-9, 0-8 1.0: Not declaring broker architecture, broker management commands. Symmetric. 8
  • 9. 9
  • 11. One Million Messages Per Second on Google 31 nodes, 8 virtual CPUs on each, 248 cores total (2014, https://blog.pivotal.io/pivotal/products/rabbitmq-hits-one-million-messages-per-second-on-google- compute-engine 11
  • 13. Exchange Direct Fanout Topic Headers Types: Features: • Durability (survive broker restart) • Auto-delete (deleted when all queues have finished using it) Default Exchange 13
  • 14. 14
  • 15. 15
  • 16. Topic Exchange * (star) can substitute for exactly one word. # (hash) can substitute for zero or more words. 16
  • 17. More Exchange Types • Headers - по заголовкам сообщения “x- match”=“any”/“all” • Dead Letter Exchange (для недоставленных сообщений) • Constant-Hash (plugin) • Delayed Exchange ( задержки перед отправкой) • more … 17
  • 18. Queues • FIFO (soft) • Durable / in-memory • Exclusive • Auto-delete • Arguments (TTL,…) 18
  • 19. Consumers • Rule: One message goes to one consumer, unless redelivery happens • Serial per Channel (thread) • Pull / Subscribe API • Send acknowledgements (ack) • can do “auto-ack” ( hits reliability ) • round robin with optional priorities 19
  • 20. 20
  • 21. 21
  • 22. Что у кролика внутри Erlang • создан в Ericsson для телеком-железа • functional • lightweight processes • good scaling over CPU • deadlocks-aware design • communication between network-distributed processes • Live code upgrade • Built in Process Monitoring and Control 22
  • 24. Spring @Bean public ConnectionFactory connectionFactory() { CachingConnectionFactory cf = new CachingConnectionFactory("localhost"); cf.setUsername("guest"); cf.setPassword("guest"); return cf; } @Bean public AmqpAdmin amqpAdmin() { return new RabbitAdmin(connectionFactory()); } @Bean public RabbitTemplate rabbitTemplate() { RabbitTemplate template = new RabbitTemplate(connectionFactory()); // Отправлять сюда template.setRoutingKey(this.helloWorldQueueName); // Чиать отсюда template.setQueue(this.helloWorldQueueName); return template; } 24
  • 25. Spring async consume @Bean public SimpleMessageListenerContainer listenerContainer() { SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); container.setConnectionFactory(connectionFactory()); container.setQueueNames(this.helloWorldQueueName); container.setMessageListener(new MessageListenerAdapter(new HelloWorldHandler())); return container; } Sync: AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class); System.out.println("Received: " + amqpTemplate.receiveAndConvert()); 25
  • 26. Spring: ListenerContainer AbstractMessageListenerContainer private volatile Object messageListener; private volatile AcknowledgeMode acknowledgeMode = AcknowledgeMode.AUTO; private MessageConverter messageConverter; private ErrorHandler errorHandler = new ConditionalRejectingErrorHandler(); … SimpleMessageListenerContainer private volatile Executor taskExecutor = new SimpleAsyncTaskExecutor(); private volatile int concurrentConsumers = 1; private volatile Integer maxConcurrentConsumers; private volatile boolean exclusive; private volatile int prefetchCount = DEFAULT_PREFETCH_COUNT; // 1 … 26
  • 27. RabbitTemplate currently, the only implementation of AMQPTemplate Methods: send(Message m, …), convertAndSend(Object o , …) … recieve(): Message, recieveAndConvert(…), recieveAndReply(…) … sendAndRecieve(…), convertSendAndRecieve(), … Features: • Retry and recovery (spring-retry) • Publisher confirms and returns (ReturnCallback, ConfirmCallback) • Message PostProcessors - after receive and before publish (zip/unzip, …) 27
  • 28. Finally, AMQP vs JMS JMS Standard API Native to Java world Enterprizzy AMQP Truly Cross - platform Comprehensive Topology More Tuning (?)
  • 29. Some Readings: “Understanding the differences between AMQP and JMS” http://www.wmrichards.com/amqp.pdf Why Erlang is good for AMQP implementation https://pubs.vmware.com/vfabric5/index.jsp#com.vmware.vfabric.rabbitmq.2.4/erlang.html Alvaro Videla’s presentation “RabbitMQ Internal Architecture” http://www.slideshare.net/old_sound/dissecting-the-rabbit All About Messaging Protocols. What Are the Differences? by Bryon Moyer http://www.eejournal.com/archives/articles/20150420-protocols/ Whats wrong with AMQP and how to fix it http://www.imatix.com/articles:whats-wrong-with-amqp/ Messaging Products performance comparison https://softwaremill.com/mqperf/
  • 30. Thanks Sincerely Yours, Maxim Konovalov BPC Banking Technologies, Runet Business Systems https://www.facebook.com/maxim.konovalov.1