amqp

rabbitmq with spring amqp - messages stuck in case of AmqpException

六眼飞鱼酱① 提交于 2019-12-01 18:55:58
I am throwing an AmqpException inside of my consumer. My expectation is that the message will return back to the queue in FIFO order and will be reprocessed sometime in the future. It seems as if Spring AMQP does not release the message back to the queue. But instead tries to reprocess the failed messages over and over again. This blocks the newly arrived messages from being processed. The ones that are stuck appear in the "unpacked" state forever inside of the AMQP console. Any thoughts? Gary Russell That's the way rabbitmq/Spring AMQP works; if a message is rejected (any exception is thrown)

Message Groups in RabbitMQ / AMQP

别等时光非礼了梦想. 提交于 2019-12-01 16:27:56
ActiveMQ / JMS has a built in-mechanism for ensuring that messages that share a common header (namely, the JMSXGroupID header) are always consumed by the same consumer of a queue when using a competing consumers pattern. The consumers of a queue are completely agnostic of the actual header values, as the guarantee of messages with a common header is performed server-side and not consumer-side. For more details on how this works, see http://activemq.apache.org/message-groups.html . Is doing such a thing possible with AMQP or with something RabbitMQ specific? As of the time this answer is

Spring Boot(十四)RabbitMQ延迟队列

守給你的承諾、 提交于 2019-12-01 15:12:14
一、前言 延迟队列的使用场景:1.未按时支付的订单,30分钟过期之后取消订单;2.给活跃度比较低的用户间隔N天之后推送消息,提高活跃度;3.过1分钟给新注册会员的用户,发送注册邮件等。 实现延迟队列的方式有两种: 通过消息过期后进入死信交换器,再由交换器转发到延迟消费队列,实现延迟功能; 使用rabbitmq-delayed-message-exchange插件实现延迟功能; 注意: 延迟插件rabbitmq-delayed-message-exchange是在RabbitMQ 3.5.7及以上的版本才支持的,依赖Erlang/OPT 18.0及以上运行环境。 由于使用死信交换器相对曲折,本文重点介绍第二种方式,使用rabbitmq-delayed-message-exchange插件完成延迟队列的功能。 二、安装延迟插件 1.1 下载插件 打开官网下载: http://www.rabbitmq.com/community-plugins.html 选择相应的对应的版本“3.7.x”点击下载。 注意: 下载的是.zip的安装包,下载完之后需要手动解压。 1.2 安装插件 拷贝插件到Docker: docker cp D:\rabbitmq_delayed_message_exchange-20171201-3.7.x.ez rabbit:/plugins

Getting “amqp:internal-error” when peeking messages from Azure Service Bus Queue using AMQP, rhea and Node

拥有回忆 提交于 2019-12-01 13:40:21
I asked the very same question few days ago: Unable to "Peek" messages from an Azure Service Bus Queue using AMQP and Node . I'm asking the same question again but with a few differences (hence, please don't mark this question as a duplicate of the other question): In the previous question, I was using nodeamqp10 library however based on some comments on the Github page for this library, I ended up using rhea instead of nodeamqp10 library. With some help from Azure Service Bus team, I made some progress and now I am getting an error back from Azure Service Bus which tells me that I am on the

RabbitMQ basic.get and acknowledgement

梦想与她 提交于 2019-12-01 13:23:18
问题 I'm invoking: GetResponse response = channel.basicGet("some.queue", false); // no auto-ack .... channel.basicAck(deliveryTag, ...); However, when I invoke basicGet , the messages in the queue stay in "Ready", rather than in "Unacknowledged". I want them to be in unacknowledged, so that I can either basic.ack them (thus discarding them from the queue), or basic.nack them 回答1: I'm doing the following to mimic Delaying the ack : At consumption time Get(consume) the message form the initial Queue

Spring AMQP: Register BlockedListener to Connection

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 11:06:32
I am trying to implement Blocked Listeners to RabbitMQ using RabbitTemplate of Spring AMQP. In my code i am using Spring-amqp 1.1.3 version jar file, whereas i have looked into the version 1.3.1 as well and this is unsupported in this version also. Does anyone know if i am missing any version which has support of registering Blocked listeners to the new connections in RabbitMQ. Or if is there any future release of spring amqp to support this feature. Example Code: Connection connection = factory.newConnection(); connection.addBlockedListener(new BlockedListener() { @Override public void

Spring AMQP: Register BlockedListener to Connection

人走茶凉 提交于 2019-12-01 09:06:56
问题 I am trying to implement Blocked Listeners to RabbitMQ using RabbitTemplate of Spring AMQP. In my code i am using Spring-amqp 1.1.3 version jar file, whereas i have looked into the version 1.3.1 as well and this is unsupported in this version also. Does anyone know if i am missing any version which has support of registering Blocked listeners to the new connections in RabbitMQ. Or if is there any future release of spring amqp to support this feature. Example Code: Connection connection =

Waiting for all rabbitmq responses on a fanout exchange?

白昼怎懂夜的黑 提交于 2019-12-01 06:23:12
I've configured a rabbitmq fanout exchange called " ex_foo " for a RPC workload. When clients connect to the server, they create their own non-durable RPC receive queue and connect to it with a BasicConsumer. The apps listen for messages/commands and respond to the queue defined in the reply_to part of the request. One of the simple messages/commands I'm sending out the the fanout exchange (and thus, every application/client connected to it) is a type of ping request message , and my problem is that I don't know how many ping responses I will get (or should expect), because I don't know how

Converting Message from RabbitMQ into string/json

这一生的挚爱 提交于 2019-12-01 04:08:51
I am currently struggling hard with a fair simple problem. I want to receive a message from RabbitMQ and have that transformed into a string (or later a json object). But all I get is bytes. The Message object displays itself as a string that way (Body:'{"cityId":644}'; ID:null; Content:application/json; Headers:{}; Exchange:; RoutingKey:pages.type.index; Reply:null; DeliveryMode:NON_PERSISTENT; DeliveryTag:1) The configuration class (using spring) @Configuration public class RabbitConfiguration { @Bean public CachingConnectionFactory connectionFactory() { CachingConnectionFactory

初探RabbitMQ系列(一)了解消息中间件的工作原理和使用

只谈情不闲聊 提交于 2019-12-01 03:49:47
文档章节 简介 消息与消息队列 性能对比 了解什么是AMQP协议? AMQP的协议模型 AMQP核心概念 AMQP消息路由 Exchange类型 RabbitMQ特点 RabbitMQ 中的概念模型 消息模型 RabbitMQ 基本概念 RabbitMQ的作用和使用场景 RabbitMQ的核心组件 Hello RabbitMQ World pom依赖 RabbitMQ web客户端 简介 目前,主流的消息中间件主要有:ActiveMQ、Kafka、RabbitMQ、RocketMQ等等......,而我们今天的主角是:RabbitMQ,RabbitMQ是一个开元基于 erlang 语言开发具有高可用高并发的优点,适合集群消息代理和队列服务器,它是基于AMQP协议来实现的,AMQP的和主要特征是面向消息、队列、路由(包括点对点和发布/订阅)、可靠性、安全,RabbitMQ支持多种语言,有消息确认机制和持久化机制,保证数据不丢失的前提做到可靠性、可用性。 消息与消息队列 消息(Message)是指应用于应用之间传送的数据,消息的类型包括文本字符串、JSON、XML、内嵌对象等等... 所谓 消息中间件 / 消息队列( Message Queue Middleware,简称MQ)是利用高效可靠的消息传递机制进行数据交流,同时可以基于数据通信来进行分布式系统的继承