<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>RabbitMQTutorial - 标签 | 飞污熊小站</title><link>https://xiongneng.me/tags/rabbitmqtutorial/</link><description>飞污熊小站</description><generator>Hugo 0.161.1 &amp; FixIt v0.4.6-20260512073637-464c4659</generator><language>zh-CN</language><managingEditor>yidao620@163.com (XiongNeng)</managingEditor><webMaster>yidao620@163.com (XiongNeng)</webMaster><copyright>XiongNeng</copyright><lastBuildDate>Sun, 17 May 2026 13:14:48 +0000</lastBuildDate><atom:link href="https://xiongneng.me/tags/rabbitmqtutorial/index.xml" rel="self" type="application/rss+xml"/><item><title>RabbitMQ简易教程 - 并发调度</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial08/</link><pubDate>Fri, 26 May 2023 09:17:21 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial08/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;RabbitMQ任务调度默认是阻塞的，使用pika中的&lt;code&gt;channel.start_consuming()&lt;/code&gt;的时候，
每次收到一条消息后会顺序执行完回调函数，发送ACK的确认消息，然后再执行下一条消息。
虽然说可同时接受多条消息，但是并不能同时处理这多条消息，那么需要自己在代码里面实现任务的并发调度。&lt;/p&gt;</description></item><item><title>RabbitMQ简易教程 - WebSocket</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial07/</link><pubDate>Wed, 17 May 2023 08:24:25 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial07/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;之前写过一篇 &lt;a href="https://www.xncoding.com/2017/05/02/web/async.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;使用Ajax实现异步任务&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt; 的文章，
介绍了对于需要知道异步处理返回结果的情况，使用Ajax的轮训和长连接方式实现。
但是这两种方式都会生成大量的HTTP连接，对服务器资源是一种巨大的浪费，
这里正式介绍如果通过&lt;code&gt;WebSocket&lt;/code&gt; + &lt;code&gt;RabbitMQ&lt;/code&gt;来优雅的实现。&lt;/p&gt;</description></item><item><title>RabbitMQ简易教程 - RPC</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial06/</link><pubDate>Tue, 16 May 2023 09:09:37 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial06/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;在教程第二篇里面我们学习了如何实现一个任务队列，异步方式去处理那些比较耗时的任务。
但是如果我们需要调用一个远程主机上面的方法，并且等待它的执行结果呢？
这种模式我们通常将它称为远程方法调用（RPC）。&lt;/p&gt;
&lt;p&gt;这一篇我们将利用RabbitMQ来构建一个RPC服务，服务器上面有一个可返回斐波拉契数的函数。
客户端通过rpc调用来获取结果。&lt;/p&gt;</description></item><item><title>RabbitMQ简易教程 - 主题</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial05/</link><pubDate>Mon, 15 May 2023 16:33:17 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial05/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;前面一篇通过使用&lt;code&gt;direct&lt;/code&gt;类型的交换机代替&lt;code&gt;fanout&lt;/code&gt;广播类型交换机，
实现了一个基于日志级别路由对应的消息的功能。&lt;/p&gt;
&lt;p&gt;但是还是有它的局限性——它并不能根据多个条件来实现路由，只能通过完全匹配&lt;code&gt;routing key&lt;/code&gt;，
灵活性不够。&lt;/p&gt;</description></item><item><title>RabbitMQ简易教程 - 路由</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial04/</link><pubDate>Sat, 13 May 2023 19:17:55 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial04/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;前面一篇实现了一个非常基础的日志系统，交换机将所有接收到的消息广播到它所知道的多个接受者。&lt;/p&gt;
&lt;p&gt;这一节我们更进一步，实现订阅部分消息的功能。比如我只讲那些ERROR级别的消息写入日志文件，
同时将所有日志打印到控制台上面。&lt;/p&gt;</description></item><item><title>RabbitMQ简易教程 - 发布订阅</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial03/</link><pubDate>Wed, 10 May 2023 13:14:22 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial03/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;前面一篇介绍的任务队列是每个消息只能被一个工作者取走。这一篇讲解发布/订阅消息模式，
在这个模式里面，一个消息可以被发送给多个消费者。&lt;/p&gt;
&lt;p&gt;这里我通过一个简单的日志系统来说明，消息生产者会将日志发送给队列，然后多个订阅者可以接收到这条日志显示到不同的地方，
比如可以打印到文件中，同时打印到控制台上面。&lt;/p&gt;</description></item><item><title>RabbitMQ简易教程 - 任务队列</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial02/</link><pubDate>Mon, 08 May 2023 09:15:22 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial02/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;这里演示的官网通过python使用消息队列的教程：&lt;a href="https://www.rabbitmq.com/getstarted.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://www.rabbitmq.com/getstarted.html&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;先演示最简单的一个入门级别的&lt;code&gt;hello world&lt;/code&gt;例子，
发送者发送一个字符串，接受者接收到消息后打印出来。然后再介绍怎样实现任务队列&lt;/p&gt;
&lt;h2 class="heading-element" id="hello-world"&gt;&lt;span&gt;hello world&lt;/span&gt;
 &lt;a href="#hello-world" class="heading-mark"&gt;
 &lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;
 &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;这里使用 python 的pika来演示，先安装pika:&lt;/p&gt;</description></item><item><title>RabbitMQ简易教程 - 安装</title><link>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial01/</link><pubDate>Sat, 06 May 2023 10:55:13 +0800</pubDate><author>yidao620@163.com (XiongNeng)</author><guid>https://xiongneng.me/posts/middleware/mq/rabbitmq-tutorial01/</guid><category domain="https://xiongneng.me/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</category><description>&lt;p&gt;最近又开始捣鼓RabbitMQ了，一个超好用的队列中间件，官网教程更新，自己也将有用的东东记录下来。&lt;/p&gt;
&lt;p&gt;测试环境：消息服务器CentOS7.4、客户端Python3.6.1&lt;/p&gt;
&lt;p&gt;RabbitMQ是一个出色的消息代理中间件（Message Broker）：接受和转发消息。你可以将它看作是一个邮局，
你把自己的信件写上收件人地址，然后放到邮筒里面就不用管了，由邮局负责将这个信件送到目的地。&lt;/p&gt;</description></item></channel></rss>