amqp

How can I list or discover queues on a RabbitMQ exchange using python?

你离开我真会死。 提交于 2019-12-17 18:27:37
问题 I need to have a python client that can discover queues on a restarted RabbitMQ server exchange, and then start up a clients to resume consuming messages from each queue. How can I discover queues from some RabbitMQ compatible python api/library? 回答1: As far as I know, there isn't any way of doing this. That's nothing to do with Python, but because AMQP doesn't define any method of queue discovery. In any case, in AMQP it's clients (consumers) that declare queues: publishers publish messages

Spring AMQP 中的核心概念

微笑、不失礼 提交于 2019-12-17 00:07:33
本文主要介绍Spring AMQP中的用于开发的核心概念 Spring AMQP 包含了两个核心的模块 spring-amqp 和 spring-rabbit . spring-amqp 模块包含了 org.springframeworks.amqp.core 包,该包里面包含了了AMQP协议里面的核心概念。本意就是该包里面的内容是一个关于AMQP协议高度抽象的层级,并不会依赖于任何具体的AMQP中间件的实现。 Message 消息 0-9-1 AMQP 协议中并没有的定义 Message 类或者接口,但是当我们在做一些基本的 操作的是时候,例如 basicPublish() 的时候,传输的内容是一个 字节数据和一些额外的分开的属性值。在 Spring AMQP 中,就定义了一个 Message 类来代表一个更通用的AMQP 域。 Message 类的主要目的就在于封装 content 和 一些属性。(实际定义和如下会有一些区别) @Data @AllArgsConstructor public class Message { private final MessageProperties messageProperties ; private final byte [ ] body ; } MessageProperties 中会定义一系诶公共的属性,比如, messageID

Linux下build和使用rabbitmq-c

白昼怎懂夜的黑 提交于 2019-12-14 17:34:46
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1) 按照 这里 介绍的方法,先安装CMake 2) 在 这里 找到下载 link ,下载rabbitmq-c的包 3) 解压,进入解压后的目录 4) mkdir build && cd build # 这一步是在rabbitmq-c的根目录下创建一个build子目录 5) cmake .. # 这一步是让cmake根据../CMakeList.txt,即rabbitmq-c的根目录下的CMakeList.txt创建Makefile文件,Makefile文件会被创建到build目录中 6) cmake --build . # 这一步是真正的build rabbitmq-c库的,注意,不要漏掉结尾的点 '.' 完成后,build目录下会出现librabbitmq、examples 和 tests 子目录。其中librabbitmq中包含生成的librabbitmq.so等文件;examples中包含amqp_bind、amqp_consumer、amqp_exchange_declare、amqp_listen、amqp_listenq、amqp_producer、amqp_rpc_sendstring_client、amqp_sendstring 和 amqp_unbind 可执行文件。 这里

Getting result of a long running task with RabbitMQ

大兔子大兔子 提交于 2019-12-14 03:45:26
问题 I have a scenario where a client sends an http request to download a file. The file needs to be dynamically generated and typically takes 5-15 seconds. Therefore I am looking into a solution that splits this operation in 3 http requests. First request triggers the generation of the file. The client polls the server every 5 seconds to check if file is ready to download When the response to the poll request is positive, the client starts downloading the file To implement this I am looking into

How do I set up a security provider in Qpid to allow anonymous and also name/password authentication?

ⅰ亾dé卋堺 提交于 2019-12-13 19:41:53
问题 This is my first day with Apache Proton and Qpid (java-broker version 0.32) and I need a simple send and receive example in Java (no JMS). By poking around I found Send.java and Recv.java neither of which actually work. On "mng.send() I get java.io.IOException: An established connection was aborted by the software in your host machine From stackoverflow and a half dozen other google searches it seems that one must create an "anonymous" security provider first. How does one do this? I can't

RabbitMQ Messaging with QPID 0.32 client

无人久伴 提交于 2019-12-13 02:33:06
问题 Using QPID Java Client i can only get messages delivered through the exchange to the bound queue using the following expanded syntax of AMQAnyDestination Destination queue = new AMQAnyDestination( new AMQShortString("onms2"), new AMQShortString("direct"), new AMQShortString("Simon"), true, true, new AMQShortString(""), false, bindvars); If i attempt to use the different form which just specifies the address as follows it doesnt work:- Destination queue = new AMQAnyDestination("onms2/Simon");

Apache Camel AMQP - ActiveMQ AMQP header mismatch value 1, expecting 0

核能气质少年 提交于 2019-12-13 02:24:05
问题 I am attempting to make an Apache Camel application that integrates with ActiveMQ over AMQP. I have been working from the provided ' camel-example-spring-jms ' project, which is over the standard TCP connection, but I have modified to use my standalone ActiveMQ 5.8 installation (rather than embedded), which I have working fine using TCP. Active MQ Configuration ( amqp on 5672 ) <transportConnectors> <transportConnector name="openwire" uri="tcp://0.0.0.0:61610?maximumConnections=1000

ConfirmListener.handleNack is not invoked when exchange is missing

孤街醉人 提交于 2019-12-13 02:15:39
问题 In my application I need to determine whether a message is successfully published into AMQP exchange or some error happens. It seems like Publisher Confirms were invented to address this issue so I started experimenting with them. For my Java application I used com.rabbitmq:amqp-client:jar:3.5.4 and I chose a very simple scenario when the exchange (where I try to publish) is missing. I expected that ConfirmListener.handleNack is going to be invoked in such case. Here's my Java code: package

python-qpid-proton examples, send message to azure not working

瘦欲@ 提交于 2019-12-13 01:23:35
问题 I'm trying to use python-qpid-proton version 0.9.1 to send a message to a Azure Service Bus queue. The examples in examples/python/messenger/ accept addresses of the form amqps://<user>:<password>@<server>/<queue name> , and I can successfully send messages to the queue I have on Azure with it. The problem with this is that I can't control much of what's going on, namely I can't really see if the sending failed. Eventually I want to persist the messages in case the internet connection goes

消息队列

笑着哭i 提交于 2019-12-12 18:52:05
什么是消息队列 把服务器比喻成一个人 当这个人的亲人,朋友,工作(一大批客户端)【生产者】同时有事情(网络请求)找他, 这个人承受不了了 就容易崩溃 那现在可以把消息队列比喻成一个管道 这个管道让消息按照 队列 数据结构(先进先出) 然后这个人再把这些消息传给可以解决的人【消费者】 消息队列的优势 应用解耦 消息队列可以使消费者和生产者直接互不干涉,互不影响,只需要把消息发送到队列即可,而且可独立的扩展或修改两边的处理过程,只要能确保它们遵守同样的接口约定,可以生产者用Node.js实现,消费者用python实现。 灵活性和峰值处理能力 当客户端访问量突然剧增,对服务器的访问已经超过服务所能处理的最大峰值,甚至导致服务器超时负载崩溃,使用消息队列可以解决这个问题,可以通过 控制消费者的处理速度 和 生产者可进入消息队列的数量 等来避免峰值问题 排序保证 消息队列可以控制数据处理的顺序,因为消息队列本身使用的是队列这个数据结构, FIFO (先进选出),在一些场景数据处理的顺序很重要,比如商品下单顺序等。 异步通信 消息队列中的有些消息,并不需要立即处理,消息队列提供了异步处理机制,可以把消息放在队列中并不立即处理,需要的时候处理,或者异步慢慢处理,一些不重要的发送短信和邮箱功能可以使用。 可扩展性 前面提到了消息队列可以做到 解耦 ,如果我们想增强消息入队和出队的处理频率,很简单