amqp

Why shouldn't I use rabbitmq topic exchanges for everything?

跟風遠走 提交于 2020-01-13 06:54:18
问题 It seems like the worker pattern, fanout, and filtered topics can all be implemented with topic exchanges. Why would I ever use a direct or fanout exchange instead? We would like to codify common patterns found in our org in a library that abstracts the infinite flexibility of amqp (naming conventions, defaulting to durable, sending common headers, expirations etc.). Should we leverage the different exchange types or implement all patterns with topics; why? (We have consumers/publishers in

AMQP Delay Delivery and Prevent Duplicate Messages

巧了我就是萌 提交于 2020-01-13 04:40:27
问题 I have a system that will generate messages sporadically, and I would like to only submit either zero or one message every 5 minutes. If no message is generated, nothing would be processed by the queue consumer. If a hundred identical messages are generated within 5 minutes I only want one of those to be consumed from the queue. I am using AMQP(RabbitMQ), is there a way to accomplish this within rabbitmq or the AMQP protocol? Can I inspect a queue's contents to ensure that I don't insert a

Centos7 手动编译 RabbitMQ ,并安装php amqp

让人想犯罪 __ 提交于 2020-01-12 09:37:54
RabbitMQ是一个在AMQP基础上完成的,可复用的企业消息系统,底层基于Erlang语言。 一:centos7安装RabbitMQ 这玩意儿安装很扯淡,官方推荐rpm安装,rpm安装本身是最简单的,但是安装RabbitMQ却不简单,很可能需要修改仓库地址。不同linux版本不一样,centos6和centos7也不一样。我这里不用rpm,手动编译Erlang,然后选择编译好的RabbitMQ。 1:安装Erlang 1):先安装几个必要的插件 yum -y install gcc glibc-devel make ncurses-devel openssl-devel autoconf unixODBC unixODBC-devel socat yum -y install wget 2):Erlang下载地址:http://www.erlang.org/downloads,我这里下载21.1版本 cd /usr/local/src/ wget http://erlang.org/download/otp_src_21.1.tar.gz #下载 tar -xvf otp_src_21.1.tar.gz #解压 ./configure --prefix=/usr/local/erlang --without-javac #忽略java编译 make && make install

Celery works, but with flower doesn't work

六眼飞鱼酱① 提交于 2020-01-12 07:45:09
问题 I have installed celery and RabitMQ and flower. I am able to browse to the flower port. I have the following simple worker that I can attach to celery and call from a python program: # -*- coding: utf-8 -*- """ Created on Sat Dec 12 16:37:33 2015 @author: idf """ from celery import Celery app = Celery('tasks', broker='amqp://guest@localhost//') @app.task def add(x, y): return x + y This program calls it # -*- coding: utf-8 -*- """ Created on Sat Dec 12 16:40:16 2015 @author: idf """ from

Retrieving number of unacknowledged messages in RabbitMQ queue from Java/ Spring

筅森魡賤 提交于 2020-01-12 07:34:24
问题 is there any way to return the number of messages that are unacknowledged? I am using this code to get the number of messages in the queue: DeclareOk declareOk = amqpAdmin.getRabbitTemplate().execute( new ChannelCallback<DeclareOk>() { public DeclareOk doInRabbit(Channel channel) throws Exception { return channel.queueDeclarePassive(name); } }); return declareOk.getMessageCount(); but I would like to know as well the number of unacknowledged messages. I have seen that the RabbitMQ Admin tool

Good Python library for AMQP [closed]

主宰稳场 提交于 2020-01-11 17:10:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Can you recommend what Python library to use for accessing AMQP (RabbitMQ)? From my research pika seems to be the preferred one. 回答1: Pika is the RabbitMQ recommended library, and py-ampqlib is also mentioned. Depending on what you're using Rabbit for, you might also want to look at Celery (a client library

Ack or Nack in rabbitMQ

非 Y 不嫁゛ 提交于 2020-01-10 07:17:24
问题 I'm using rabbitMQ, I take every message from queue with basic_get without automatically acking procedure, which means the message remain in queue until I ack or nack the message. Sometimes I've messages that can't be processed because of some exception thrown, which prevented them from being fully processed. Question is what does it matter if I both ack the messages in success and exception thrown, I mean in terms of result messages will always get out of the queue, so what does it matter if

SpringBoot连接多RabbitMQ源

江枫思渺然 提交于 2020-01-07 12:08:56
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在实际开发中,很多场景需要异步处理,这时就需要用到RabbitMQ,而且随着场景的增多程序可能需要连接多个RabbitMQ。SpringBoot本身提供了默认的配置可以快速配置连接RabbitMQ,但是只能连接一个RabbitMQ,当需要连接多个RabbitMQ时,默认的配置就不太适用了,需要单独编写每个连接。 在SpringBoot框架中,我们常用的两个类一般是: RabbitTemplate :作为生产、消费消息使用; RabbitAdmin :作为申明、删除交换机和队列,绑定和解绑队列和交换机的绑定关系使用。 所以我们连接多个RabbitMQ就需要重新建立连接、重新实现这两个类。 代码如下: 配置 application.properties 配置文件需要配置两个连接: server.port=8080 # rabbitmq v2.spring.rabbitmq.host=host v2.spring.rabbitmq.port=5672 v2.spring.rabbitmq.username=username v2.spring.rabbitmq.password=password v2.spring.rabbitmq.virtual-host=virtual-host #consume 手动 ack

SpringBoot整合RabbitMQ

霸气de小男生 提交于 2020-01-06 18:53:02
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> SpringBoot框架已经提供了RabbitMQ的使用jar包,开发人员在使用RabbitMQ的时候只需要引用jar包简单的配置一下就可以使用RabbitMQ,这极大的简化了开发人员的开发成本,提升开发效率。 话不多说,直接上代码: 先在 pom.xml 文件添加依赖 spring-boot-starter-amqp 如下: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>spring-boot-rabbitmq</artifactId> <version>1.0-SNAPSHOT</version> <description>springboot整合RabbitMQ的示例<

AMQ Address with multiple clients to a multicast queue

半城伤御伤魂 提交于 2020-01-06 05:38:07
问题 My query is for the product Red Hat AMQ 7.X (and I am using 7.2), which is based on Apache ActiveMQ Artemis and a .Net client connecting to the queue using AMQP protocol. An Artemis article discusses unicast (point-to-point), multicast (publish-subscribe) and a combination of these addressing: https://activemq.apache.org/artemis/docs/2.0.0/address-model.html It does not detail the case of two consumers connecting to the same multicast queue under an address. Our requirement is to Have pub-sub