amqp

Return message to the end of queue in rabbitmq

北慕城南 提交于 2019-12-08 06:19:09
问题 I have exchange and queue. Producer doesn't need consumption confirmation, but messages in some cases can be un-processable by consumer in current moment, because of lack of other data. Because of this, I want to return those messages to the end of queue. How to do this? Or is it done automatically when I reject message? Flow: Message1 gets consumed and creates some record in database. Message2 gets consumed and checks if there is record in database, and if yes, then it updates the record. If

Is there an API for listing queues and exchanges on RabbitMQ?

半世苍凉 提交于 2019-12-08 02:52:15
问题 I've looked quite a bit, but I haven't been able to find a good programmatic way to list the queues on a RabbitMQ server. This is important because I need to clean up my queues and exchanges when I'm done with them. I don't always have a good "done" event that can be used to trigger a cleanup, so I'd like to do it with more of a garbage collection model. If I can list the queues, I can verify that the objects that they're related to shouldn't be producing more entries and clean them up. I

How can I Send/Receive a message from Azure Service Bus from Qpid JMS (qpid-jms-client-0.11.1.jar)?

两盒软妹~` 提交于 2019-12-08 02:44:52
问题 I am currently researching how to connect to Azure Service Bus using Qpid JMS (qpid-jms-client-0.11.1.jar). I have created a Demo Java application SimpleSenderReceiver which connects to an already configured Azure Service Bus using the following guide (#link1). This code seems to work using a "very" old version om the Qpid JMS client (version 0.32). I am now trying to get it to work with the latest stable version of Qpid JMS (qpid-jms-client-0.11.1.jar), And so far I have not been successful.

Python Celery - lookup task by pid

不打扰是莪最后的温柔 提交于 2019-12-08 02:23:36
问题 A pretty straightforward question, maybe - I often see a celery task process running on my system that I cannot find when I use celery.task.control.inspect() 's active() method. Often this process will be running for hours, and I worry that it's a zombie of some sort. Usually it's using up a lot of memory, too. Is there a way to look up a task by linux pid? Does celery or the AMPQ result backend save that? If not, any other way to figure out which particular task is the one that's sitting

Spring AMQP exception handling basics

血红的双手。 提交于 2019-12-08 00:57:19
问题 I have a Listener class (that implements Spring's MessageListener interface) where I need to not requeue any messages if an exception occurs, but I want to post the message to a different queue. It seems like I need the Listener to catch an AmqpRejectAndDontRequeueException , but I've read that I need it to throw the exception instead. If I do that, I can't re-post the message. Should I just catch a plain Exception and do the re-post there? Is there any need to actually throw the

RabbitMQ学习之:(三)AMQP和RabbitMQ介绍

丶灬走出姿态 提交于 2019-12-07 15:28:21
准备开始 高级消息队列协议(AMQP 1 )是一个异步消息传递所使用的应用层协议规范。作为线路层协议,而不是API(例如JMS 2 ),AMQP客户端能够无视消息的来源任意发送和接受信息。现在,已经有相当一部分不同平台的服务器 3 和客户端可以投入使用 4 。 AMQP的原始用途只是为金融界提供一个可以彼此协作的消息协议,而现在的目标则是为通用消息队列架构提供通用构建工具。因此,面向消息的中间件(MOM)系统,例如发布/订阅队列,没有作为基本元素实现。反而通过发送简化的AMQ实体,用户被赋予了构建例如这些实体的能力。这些实体也是规范的一部分,形成了在线路层协议顶端的一个层级:AMQP模型。这个模型统一了消息模式,诸如之前提到的发布/订阅,队列,事务以及流数据,并且添加了额外的特性,例如更易于扩展,基于内容的路由。 本文中区别发布/订阅是为了将生产者和消费者拆分开来: 生产者无需知道消费者按照什么标准接受消息 。队列是一个先入先出的数据结构。路由封装了消息队列中的消息的相关信息,这些信息决定了消息在异步消息系统中的最终展现形式。 在这里,我尝试解释一下这个模型的一些概念,Aman Gupta使用Ruby 5 实现了AMQP模型 6 。它使用的是一种事件驱动架构(基于EventMachine 7 ),在阅读和使用的时候都会让人觉得有些不太熟悉

RabbitMQ(1)-AMQP

北城余情 提交于 2019-12-07 14:35:53
1.1 简介 AMQP 全称是 Advanced MessageQueuing Protocol ( 高级消息队列协议 ) 。 AMQP 是一个应用层的异步消息传递协议,为面向消息的中间件而设计。其目的是通过协议使应用模块之间或应用程序与中间件等进行充分解耦。而在设计初期, AMQP 的原始用途只是为金融界提供一个可以彼此协作的消息协议。现在已经有相当一部分遵循 AMQP 的服务器和客户端供使用。其中 RabbitMQ 是 AMQP 的一款开源标准实现。 06 年初 AMQP 协议发布, 06 年底 RabbitMQ1.0 版本发布 1.2 概念 AMQP 有四个非常重要的概念:虚拟机 (virtual host) ,交换器 (exchange) ,队列 (queue) 和绑定 (binding) 。 虚拟机 (virtual host): 通常是应用的外在边界,我们可以为不同的虚拟机分配访问权限。虚拟机可持有多个交换器、队列和绑定。 vhost 作用 : a. 逻辑分离允许为不同应用程序安全保密的运行数据,将 rabbit 的众多客户区分开来,避免队列和交换器的命名冲突; b. 权限控制以 vhost 为单位; c.vhost 之间是绝对隔离的,无法将 vhost1 上的交换器绑定到 vhost2 中的队列去; d. 可以安全的迁移到新的 RabbitMQ 服务器上处理新的负载

Making RabbitMQ listen only to the loopback interface?

回眸只為那壹抹淺笑 提交于 2019-12-07 12:32:03
问题 How do I instruct the RabbitMQ processes ( epmd and beam.smp ) to listen only to the loopback interface ( 127.0.0.1 )? 回答1: You sure can - edit your /etc/rabbitmq/rabbitmq.conf and add the line: NODE_IP_ADDRESS=127.0.0.1 you also probably want to add: NODENAME=rabbit@localhost which will set your node to listen on localhost. 来源: https://stackoverflow.com/questions/6145137/making-rabbitmq-listen-only-to-the-loopback-interface

How do I load test a RabbitMQ server (Either using JMeter, python or any other tool..)?

我怕爱的太早我们不能终老 提交于 2019-12-07 07:59:00
问题 I have been given access to a RabbitMQ server to do a load test on it. I'm completely new to servers and AMQ protocol. I've been researching online to see what are some different methods. So far I'm investigating two methods. JMeter; I have found this project: https://github.com/jlavallee/JMeter-Rabbit-AMQP#build-dependencies . It gives me a jar file which I can create JMeter AMQP consumer and publisher, but I have no idea what to put in the fields. (virtual host vs host - dunno my ports -..)

Celery task state depends on CELERY_TASK_RESULT_EXPIRES

帅比萌擦擦* 提交于 2019-12-07 06:36:50
问题 From what I have seen, the task state depends entirely on the value set for CELERY_TASK_RESULT_EXPIRES - if I check the task state within this interval after the task has finished executing, the state returned by: AsyncResult(task_id).state is correct. If not, the state will not be updated and will remain forever PENDING. Can anyone explain me why does this happen? Is this a feature or a bug? Why is the task state depending on the result expiry time, even if I am ignoring results? (Celery