amqp

Dead-letterred messages not getting requeue to original queue after ttl

时光毁灭记忆、已成空白 提交于 2019-11-29 12:42:23
I have planned to delay the processing of messages in queue by following these two links link1 link2 . So, as suggested in the link. I have declared the original queue with the x-dead-letter-exchange and x-dead-letter-routing-key args. Which published the messages to the so called dead-letter-queue when message either failed to get processed by consumer or ttl happen or queue length exceed. Now in the dead-letter-queue similar args have been set along with the ttl parameter. Which is suppose to republish the messages to the original queue after ttl exceed. But the problem is it is dropping all

Celery does not release memory

这一生的挚爱 提交于 2019-11-29 12:30:41
问题 It looks like celery does not release memory after task finished. Every time a task finishes, there would be 5m-10m memory leak. So with thousands of tasks, soon it will use up all memory. BROKER_URL = 'amqp://user@localhost:5672/vhost' # CELERY_RESULT_BACKEND = 'amqp://user@localhost:5672/vhost' CELERY_IMPORTS = ( 'tasks.tasks', ) CELERY_IGNORE_RESULT = True CELERY_DISABLE_RATE_LIMITS = True # CELERY_ACKS_LATE = True CELERY_TASK_RESULT_EXPIRES = 3600 # maximum time for a task to execute

RabbitMQ源码解析前奏--AMQP协议

只谈情不闲聊 提交于 2019-11-29 09:58:11
一、协议 AMQP协议分层类似于OSI或TCP/IP协议分层。从图中可以看出分三层: 图1 AMQP协议分层图 1、Model Layer 规范服务器端Broker的行为。 2、Session Layer 定义客户端与服务器端Broker的Context。 3、Transport Layer 传输二进制数据流。 二、模型 AMQP服务器Broker主要由Exchange和Message Queue组成,主要功能是Message的路由Routing和缓存Buffering。 图2 AMPQ服务器模型图 Exchange接受Producer发送的Message并根据不同路由算法将Message发送到Message Queue。 Message Queue会在Message不能被正常消费时将其缓存起来,但是当Consumer与Message Queue之间的连接通畅时,Message Queue将Message转发给Consumer。 Message由Header和Body组成,Header是由Producer添加的各种属性的集合,包括Message是否客被缓存、由哪个Message Queue接受、优先级是多少等。而Body是真正需要传输的APP数据。 Exchange与Message Queue之间的关联通过Binding来实现。Exchange在与多个Message

SpringBoot | 第十二章:RabbitMQ的集成和使用

纵然是瞬间 提交于 2019-11-29 08:01:00
前言 上节讲了缓存数据库 redis 的使用,在实际工作中,一般上在系统或者应用间通信或者进行异步通知(登录后发送短信或者邮件等)时,都会使用消息队列进行解决此业务场景的解耦问题。这章节讲解下消息队列 RabbitMQ 的集成和简单使用示例。 RabbitMQ介绍 SpringBoot集成RabbitMQ 总结 最后 老生常谈 RabbitMQ介绍 RabbitMQ是一个开源的AMQP实现,服务器端用Erlang语言编写,支持多种客户端,如:Python、Ruby、.NET、Java、JMS、C、PHP、ActionScript、XMPP、STOMP等,支持AJAX。用于在分布式系统中存储转发消息,在易用性、扩展性、高可用性等方面表现不俗。 关于 AMQP (摘自互联网): AMQP,即Advanced Message Queuing Protocol,高级消息队列协议,是应用层协议的一个开放标准,为面向消息的中间件设计。消息中间件主要用于组件之间的解耦,消息的发送者无需知道消息使用者的存在,反之亦然。 AMQP的主要特征是面向消息、队列、路由(包括点对点和发布/订阅)、可靠性、安全。 题外话:其实 Redis 也有提供队列功能。但我觉得, redis 还是专门用在缓存方面吧。 SpringBoot集成RabbitMQ 0.老规矩,加入pom依赖,这已经是 Springboot

Is it possible to move / merge messages between RabbitMQ queues?

喜你入骨 提交于 2019-11-29 07:57:37
I'm looking to know is it possible to move / merge messages from one queue to another. For example: main-queue contains messages ['cat-1','cat-2','cat-3','cat-4','dog-1','dog-2','cat-5'] dog-queue contains messages ['dog-1, dog-2, dog-3, dog-4] So the question is, (assuming both queues are on the same cluster, vhost) it possible to move messages from dog-queue to main-queue using rabbitmqctl ? So at the end I'm looking to get something like: Ideally: main-queue : ['cat-1','cat-2','cat-3','cat-4','dog-1','dog-2','cat-5', dog-3, dog-4] But this is ok too: main-queue : ['cat-1','cat-2','cat-3',

PHP消息队列rabbitmq——windows

偶尔善良 提交于 2019-11-29 06:32:26
一.安装拓展 因为RabbitMQ是由erlang语言实现的,所以先要安装erlang环境 erlang 下载安装 http://www.erlang.org/download.html rabbitmq 下载安装 https://www.rabbitmq.com/install-windows.html php的amqp扩展下载地址: http://pecl.php.net/package/amqp erlang和rabbitmq_server直接下载安装包安装; amqp拓展下载要选好版本;根据系统选择32位还是64位的。查看phpInfo中:Thread Safety:如果是enabled就选ts版。disabled选择nts版。 安装拓展方法: 下载解压;将php_amqp.dll复制到php/ext; php.int(我配置了php7.1环境,修改的是phpForApache.ini)中加上extension=php_amqp.dll; 复制rabbitmq.4.dll到php目录下; 在apache配置文件httpd.conf中添加一行 LoadFile "${INSTALL_DIR}/bin/php/php7.1.9/rabbitmq.4.dll" 注意:${INSTALL_DIR}是代替wampserver安装目录,/bin/php/php7.1.9

How to delay? - php-amqplib

徘徊边缘 提交于 2019-11-29 04:32:43
I would like to know how to delay with Amqpphplib. I used this great coffee script tutorial : https://github.com/jamescarr/rabbitmq-scheduled-delivery but it doesn't seems to work with PHP-amqplib. The message expires as I want, but it seems that "x-dead-letter-exchange" don't do the work. I used RabbitMQ management console and I see all queue creation and deletion in live. But my message do go to the immediate queue after expiring. I use RabbitMQ 3.2.3 version, PHP-amqplib 2.2.* version. Here is my code : Connection class : class Connection { /** * @var $ch */ public $ch; /** * @var $consumer

Recovering from zmq.error.ZMQError: Address already in use

风流意气都作罢 提交于 2019-11-29 02:57:39
问题 I hit Ctrl-C while running a PAIR pattern (non-blocking client servers) connection with ZMQ. Later when I tried running the REQ-REP (blocking client single server connection) pattern, I keep getting the Address already in use error. I have tried running netstat with netstat -ltnp | grep :<my port> but that does not list any process. So who exactly is using this address? Also how does one gracefully shutdown socket connections like these? 回答1: Question 1: If you do sudo netstat -ltnp , on a

Specific advantages of NServiceBus over plain RabbitMQ

左心房为你撑大大i 提交于 2019-11-28 23:48:35
问题 Are there any advantages of using NServiceBus over simply using the .net driver for RabbitMQ (assuming we can replace MSMQ with AMQP). Does NSB provide any additional functionality or abstractions that are not available directly in AMQP. 回答1: Main advantages include (but are not limited to): Takes care of serialization/deserialization of messages. Provides a neat model for dispatching messages w. handlers, polymorphic dispatch, arranging handlers in a pipeline etc. Handles unit of work.

Use of messaging like RabbitMQ in web application?

ぃ、小莉子 提交于 2019-11-28 23:36:37
问题 I would like to learn what are the scenarios/usecases/ where messaging like RabbitMQ can help consumer web applications. Are there any specific resources to learn from? What web applications currently are making use of such messaging schemes and how? 回答1: In general, a message bus (such as RabbitMQ, but not limited to) allows for a reliable queue of job processing. What this means to you in terms of a web application is the ability to scale your app as demand grows and to keep your UI quick