RabbitMQ Learn Record

Language: Python

Protocols Base: AMQP 0-9-1

To communicate, firstly build a Connection with server.


     connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))

After Connection established, we get a channel from the connection:
   
     channel = connection.channel()

Because rabbitMQ based on queue message, we to create a queue which the message will be delivered.


  channel.queue_declare(queue='hello')


After queue established, we start to send message:
 
    channel.basic_publish(exchange='', routing_key='hello', body='hello world')

The parameter body is the message we'll send

After that, we close the connection. We don't have to close the channel or other operation like sql operation.
  connection.close()





转载于:https://www.cnblogs.com/-Doraemon/p/4700059.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Key Features, Learn to administer, configure, and manage RabbitMQ instancesDiscover ways to secure and troubleshoot RabbitMQ instancesThis book is fully up-to-date with all the latest changes to version 3.5, Book Description, RabbitMQ is Open Source Message Queuing software based on the Advanced Message Queue Protocol Standard written in the Erlang Language. RabbitMQ is an ideal candidate for large-scale projects ranging from e-commerce and finance to Big Data and social networking because of its ease of use and high performance. Managing RabbitMQ in such a dynamic environment can be a challenging task that requires a good understanding not only of how to work properly with the message broker but also of its best practices and pitfalls., Learning RabbitMQ starts with a concise description of messaging solutions and patterns, then moves on to concrete practical scenarios for publishing and subscribing to the broker along with basic administration. This knowledge is further expanded by exploring how to establish clustering and high availability at the level of the message broker and how to integrate RabbitMQ with a number of technologies such as Spring, and enterprise service bus solutions such as MuleESB and WSO2. We will look at advanced topics such as performance tuning, secure messaging, and the internals of RabbitMQ. Finally we will work through case-studies so that we can see RabbitMQ in action and, if something goes wrong, we'll learn to resolve it in the Troubleshooting section., What you will learn, Apply messaging patterns using the message brokerAdminister RabbitMQ using the command line, management Web console, or management REST servicesCreate a cluster of scalable, and highly-available, RabbitMQ instancesUse RabbitMQ with the Spring Framework, MuleESB, WSO2, and Oracle databasesDeploy RabbitMQ using Puppet, Vagrant, or DockerFine-tune the performance of RabbitMQMonitor RabbitMQ using Nagios, Munin, or MonitSecure, troubleshoot, and extend RabbitMQ, About the Author, Martin Toshev is a software developer and Java enthusiast with more than eight years of experience and vast expertise originating from projects in areas such as enterprise Java, social networking, source code analysis, Internet of Things, and investment banking in companies such as Cisco and Deutsche Telekom. He is a graduate of computer science from the University of Sofia. He is also a certified Java professional (SCJP6) and a certified IBM cloud computing solution advisor. His areas of interest include a wide range of Java-related technologies (Servlets, JSP, JAXB, JAXP, JMS, JMX, JAX-RS, JAX-WS, Hibernate, Spring Framework, Liferay Portal, and Eclipse RCP), cloud computing technologies, cloud-based software architectures, enterprise application integration, and relational and NoSQL databases. Martin is one of the leaders of the Bulgarian Java Users group (BGJUG), a regular speaker at Java conferences, and one of the organizers behind the jPrime conference in Bulgaria (http://jprime.io/)., Table of Contents, Introducing RabbitMQDesign Patterns with RabbitMQAdministration, Confi guration, and ManagementClusteringHigh AvailabilityIntegrationsPerformance Tuning and MonitoringTroubleshootingSecurityInternalsContributing to RabbitMQ

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值