RabbitMQ

为什么使用RabbitMq而不是ActiveMq或者RocketMq实现消息队列

[亡魂溺海] 提交于 2020-01-04 03:05:10
为什么使用RabbitMq而不是ActiveMq或者RocketMq? 首先,从业务上来讲,我并不要求消息的100%接受率,并且,我需要结合php开发,RabbitMq相较RocketMq,延迟较低(微妙级)。至于ActiveMq,貌似问题较多。RabbitMq对各种语言的支持较好,所以选择RabbitMq。 先安装PHP对应的RabbitMQ,这里用的是 php_amqp 不同的扩展实现方式会有细微的差异. php扩展地址 : http://pecl.php.net/package/amqp 具体以官网为准 http://www.rabbitmq.com/getstarted.html 介绍 config.php 配置信息 BaseMQ.php MQ基类 ProductMQ.php 生产者类 ConsumerMQ.php 消费者类 Consumer2MQ.php 消费者2(可有多个) config.php <?php return [ //配置 'host' => [ 'host' => '127.0.0.1', 'port' => '5672', 'login' => 'guest', 'password' => 'guest', 'vhost'=>'/', ], //交换机 'exchange'=>'word', //路由 'routes' => [], ]; BaseMQ

Is there any option to set AutomaticRecoveryEnabled in RabbitMQ using Spring-AMQP?

蹲街弑〆低调 提交于 2020-01-04 02:45:14
问题 Getting stocked while doing with RabbitMQ using Spring-AMQP. Just need to get a way to configure AutomaticRecoveryEnabled and NetworkRecoveryInterval using Spring-AMQP. There is a direct option to set these flages if you you developing using native RabbitMQ library. But i didn't find a workaround to do the same using spring Using RabbitMQ Native library(don't need any help) factory.setAutomaticRecoveryEnabled(true); factory.setNetworkRecoveryInterval(10000); Using Spring-AMPQ(need help) Like

“Error: Failed to initialize erlang distribution:” trying to run “rabbitmqctl status”

醉酒当歌 提交于 2020-01-04 02:18:12
问题 This question has been asked before (RabbitMQ Failed to initialize erlang distribution), but I haven't been able to find out how to fix it from the existing answers. Following https://www.rabbitmq.com/man/rabbitmqctl.1.man.html, I'd like to run the rabbitmqctl status command to display information about the RabbitMQ broker. However, I get an error message: kurt@kurt-ThinkPad:~$ rabbitmqctl status Error: Failed to initialize erlang distribution: {{shutdown, {failed_to_start_child, net_kernel,

how can I purge a MassTransit queue?

一笑奈何 提交于 2020-01-03 17:34:44
问题 I'd like to delete all the messages from a queue in my integration test SetUp routine, how can I accomplish that? No luck with googling/intellisense-bruteforce. If it matters -- I'm using RabbitMq as transport. 回答1: There's no way to "delete" from queues within MassTransit. For tests you can use temporary, random queue URIs via rabbitmq://localhost/*?temporary=true . Or you can just append ?temporary=true to the end of your existing queue URIs to have MT clean stuff up afterward. Note:

How to Give manual Acknowledge using JmsTemplate and delete message from Rabbitmq queue

徘徊边缘 提交于 2020-01-03 17:24:28
问题 I am using RabbitMq(with JMS) with jmsTemplate I am able to Consume Message from RabbitMq Queue But it is taking acknowledgment AUTO. I have Search API for it but not able to find it out. How can I set manual acknowledgment. In Below code when Message is consumed from queue I want to call web service with that message and depends on that response from from I want to delete that message from queue. I have created one project in which I am using Listener and other project with call to read

Integrating Spring Cloud Sleuth with Spring boot amqp

白昼怎懂夜的黑 提交于 2020-01-03 16:52:08
问题 Looking for an example that shows integrating spring cloud sleuth with spring boot amqp (rabbit) publisher and subscriber. I do see the following messages in the log 2016-10-21 08:35:15.708 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.controllers.MessagingController : Received Request to pulish with Activity OrderShipped 2016-10-21 08:35:15.730 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.service

“Directory name is invalid.” etc. with rabbitmq-plugins on Windows

孤者浪人 提交于 2020-01-03 13:14:11
问题 I'm trying to get RabbitMQ going on Windows 10 by following these instructions. However, when trying to enable the management plugin via powershell command: ./rabbitmq-plugins enable rabbitmq_management I get the following: The directory name is invalid. The filename, directory name, or volume label syntax is incorrect. Unsupported node name: hostname is invalid (possibly contains unsupported characters). If using FQDN node names, use the -l / --longnames argument. I've tried setting

Getting MountVolume.SetUp failed for volume while installing stable RabbitMQ in Kubernetes

懵懂的女人 提交于 2020-01-03 11:32:13
问题 I am getting below error while doing the installation of RabbitMQ through helm install. MountVolume.SetUp failed for volume "config-volume" : couldn't propagate object cache: timed out waiting for the condition Below is the details of kubectl version: Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.2", GitCommit:"17c77c7898218073f14c8d573582e8d2313dc740", GitTreeState:"clean", BuildDate:"2018-10-24T06:54:59Z", GoVersion:"go1.10.4", Compiler:"gc", Pl atform:"linux/amd64"}

Using DbContext in RabbitMQ Consumer (Singleton Service)

自闭症网瘾萝莉.ら 提交于 2020-01-03 11:28:08
问题 I have a RabbitMQ Singleton that is working fine, but has a dependency on a scoped service whenever a message arrives: consumer.Received += _resourcesHandler.ProcessResourceObject; //Scoped Service My services are registered like so: services.AddScoped<IHandler, Handler>(); services.AddSingleton<RabbitMqListener>(); The scoped services constructors uses DI for the Db Context: private readonly ApplicationDbContext _appDbContext; public ResourcesHandler(ApplicationDbContext appDbContext) {

Spring RabbitTemplate - How to create queues automatically upon send

孤街醉人 提交于 2020-01-03 10:54:40
问题 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