RabbitMQ

Spring RabbitTemplate - How to create queues automatically upon send

只愿长相守 提交于 2020-01-03 10:52:47
问题 I am using RabbitMQ together with Spring's RabbitTemplate. When sending messages to queues using the template send methods, I want the queue to automatically be created/declared if it is not already exists. It is very important since according to our business logic queue names are generated on run-time and I cannot declare them in advance. Previously we have used JmsTemplate and any call to send or receive automatically created the queue. 回答1: Yes, you can use a RabbitAdmin and admin

Adding values to header in MassTransit.RabbitMq

旧街凉风 提交于 2020-01-03 09:07:15
问题 I am using MassTransit 3.0.0.0 and I have a hard time understanding how to intercept messages in a Request-Response scenario on their way out and add some information to the headers field that I can read on the receiver's end. I was looking at the Middleware, as recommended in the MassTransit docs - see Observers warning - but the context you get on the Send is just a Pipe context that doesn't have access to the Headers field so I cannot alter it. I used the sample provided in Middleware page

How to connect celery to rabbitMQ using SSL

末鹿安然 提交于 2020-01-03 05:14:06
问题 I'm trying to connect celery with a rabbitMQ broker using SSL certificates. This is the code: from celery import Celery import ssl broker_uri = 'amqp://user:pwd@server:5672/vhost' certs_conf = { "ca_certs": "/certs/serverca/cacert.pem", "certfile": "/certs/client/rabbit-cert.pem", "keyfile": "/certs/client/rabbit-key.pem", "cert_reqs": ssl.CERT_REQUIRED } app = Celery('tasks', broker=broker_uri) app.conf.update(BROKER_USE_SSL=certs_conf) app.send_task('task.name', [{'a': 1}]) When I try to

RabbitMQ Shovel won't start

拜拜、爱过 提交于 2020-01-03 04:47:09
问题 I have a pair of computers running arch linux with rabbitmq message queues and I want to use a shovel to move messages from the queue on the first computer to the queue on the second. Unfortunately I can't seem to create a shovel, or even verify that my rabbitmq.config file is being read. Computer 1 has an ip address of 192.168.6.66 /etc/rabbitmq/rabbitmq-env.conf NODENAME=bunny NODE_IP_ADDRESS=192.168.6.66 NODE_PORT=5672 LOG_BASE=/var/log/rabbitmq MNESIA_BASE=/var/lib/rabbitmq/mnesia

Send Images using RabbitMQ

人走茶凉 提交于 2020-01-03 02:54:09
问题 I want to transfer an image from a client to the server using RabbitMQ. However, from whatever I read, I understood that RabbitMQ can only transfer a stream of text. So how to transfer an image? 回答1: The amqp body is a buffer, you can send what you want. In general, if you want to send a file, you have to read it and send the buffers. You should send the file using more publish and not just one, then recreate the file on the consumer side. You should avoid sending big buffer. 来源: https:/

rabbitmq消息队列

為{幸葍}努か 提交于 2020-01-02 21:42:40
rabbitmq消息队列的学习 1.优点:能够保证消息数据持久化,不丢失 安装rabbitmq 1.安装erlang $ yum -y install erlang2.安装RabbitMQ $ yum -y install rabbitmq-server3.启动(无用户名密码): systemctl start rabbitmq-server 查看是否启动: netstat -tunlp 0 0.0.0.0:4369 0.0.0.0:* LISTEN 3134/epmd 4.开启rabbitmq的web控制台 #开启web界面rabbitmqrabbitmq-plugins enable rabbitmq_management浏览器访问: http://192.168.91.128:15672/ 5.重启rabbitmq systemctl restart rabbitmq-server 6.创建rabbitmq用户 # 设置新用户kevins 密码123sudo rabbitmqctl add_user kevins 123 7. 设置用户为admin角色sudo rabbitmqctl set_user_tags kevins administrator 8.允许kevins用户对所有的队列进行读写 sudo rabbitmqctl set_permissions -p "/"

Is there any specific way for Axon migration from 2.4.3 version to 3.1.1

邮差的信 提交于 2020-01-02 10:13:28
问题 I am new to axon and doing migration from Axon 2.4.3 to 3.1.1 but I am not able to find any migration guide which is available for other version? Can you please share your experience on how to do the same. I am facing a lot problem, some classes have been removed, some packages have been changed. For some classes I am even not able to find replacements, so please help me with some suggestion. If there is a guide for same please provide me with link of that. Thanks in Advance Acctually I am

Catching events prior to subscription with FromEventPattern

大兔子大兔子 提交于 2020-01-02 05:33:29
问题 I'm writing a listener for messages using the Rx framework. The problem I'm facing is that the library I'm using uses a consumer that publishes events whenever a message has arrived. I've managed to consume the incoming messages via Observable.FromEventPattern but I have a problem with the messages that are already in the server. At the moment I have the following chain of commands Create a consumer Create an observable sequence with FromEventPattern and apply needed transformations Tell the

How to listen to multiple queues with autowired Spring Boot?

别说谁变了你拦得住时间么 提交于 2020-01-02 04:30:48
问题 I'm new to Spring boot and I'm playing around with it. Currently I've build some apllications that I want to be able to communicate with each other through queues. I currently have a Listener object that can receive message from a particular queue. @Configuration public class Listener { final static String queueName = "myqueue"; @Bean SimpleMessageListenerContainer container(ConnectionFactory connectionFactory, MessageListenerAdapter listenerAdapter) { SimpleMessageListenerContainer container

Rabbitmq retrieve multiple messages using single synchronous call using .NET

你离开我真会死。 提交于 2020-01-02 03:58:04
问题 Is there a way to receive multiple message using a single synchronous call using .NET? I've seen question and I've found java class com.rabbitmq.client.QueueingConsumer, but I haven't found such client class in .NET namespaces (RabbitMQ.Client, RabbitMQ.Client.Events) 回答1: You can retrieve as many messages as you want using the BasicQoS.PrefetchCount : var model = _rabbitConnection.CreateModel(); // Configure the Quality of service for the model. Below is how what each setting means. //