Since RabbitMq version 3.8.0 queues are create with x-queue-type: classic by default, this seems to be causing an error on EasyNetQ.
Running the following snippet will trigger an error
this.bus.Receive(queueName, onMessage);
Error
The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text='PRECONDITION_FAILED - inequivalent arg 'x-queue-type' for queue 'TheQueue' in vhost '/': received none but current is the value 'classic' of type 'longstr'', classId=50, methodId=10
I did some tests and I know for a fact that the problem is the queue type, I would like to be able to connect EasyNetQ to this kind of queue but I couldn find any reference in the documentation on how to do this.
Thanks for reporting this. It is in fact a bug in RabbitMQ. I created an issue report here if you would like to follow along. The fix will ship in version 3.8.2.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
Faced same issue in 3.8.0.
I verified in 3.8.23 - The issue is resolved.
I was following this tutorial.
https://medium.com/swlh/guide-to-nest-js-rabbitmq-microservices-e1e8655d2853
It does clearly mention to use 3.8.2. I still tired 3.8.0 and hit the issue.
Related
I came across an interesting subject when reading the book "RabbitMQ in Action" by Manning. Apparently it's possible to set up consumers to be able to receive all RabbitMQ logging in real time in the consumer.
I read that RabbitMQ publishes logging to an exchange of type topic called amq.rabbitmq.log. Consumers can listen to specific severity levels, for example it can be filtered by setting the routing key to error, warning or info.
My question is; I installed a default RabbitMQ server on my PC, but I couldn't find any exchange called amq.rabbitmq.log. Only one which could be related is amq.rabbitmq.trace, but this one is used for events (events like queue.deleted, queue.created, ...), in other words that one is not what I'm looking for.
Can anyone bring clarification to my questions? Why is the amq.rabbitmq.log exchange not available on a clean RabbitMQ server installation?
citation:
Perhaps when you were listing exchanges using rabbitmqctl you spotted
an exchange called amq.rabbitmq.log whose type is topic. RabbitMQ will
publish its logs to that exchange using the severity level as a
routing key - you'll get error, warning and info. Based on what you
learned from the previous chapters you can create a consumer to
listen to those logs and react accordingly.
You have to enable it. Create the /etc/rabbitmq/rabbitmq.conf file and ensure that this line is present in it:
log.exchange = true
I just grepped the source for the rabbitmq.com website and don't see that setting documented anywhere. If you'd like, file a new issue in that repository and I'll fix it, or open your own PR to do so.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
It is a bit late, but hope it help someone. So far it works for me. The exchange "amq.rabbitmq.log" will be created automatically by the rabbitmq broker itself. The RabbitMQ broker version that I am using is: 3.8.1
add
log.exchange = true
into your rabbitmq.conf file and restart your rabbitmq service.
You will need to restart your rabbitmq service everytime you had updated the rabbitmq.conf file.
open cmd and enter the following in windows:
rabbitmq-service stop
rabbitmq-service install
rabbitmq-service start
rabbitmqctl start_app
I'm kind of new to these protocols, and just started exploring Message brokers like Apache Apollo and RabbitMQ.
So my broker receives MQTT messages from a publisher. And I would like to convert it into AMQP (preferably) or STOMP protocol to send to a web server. But I've so far been unable to do so.
I looked into RabbitMQ, and tried enabling the MQTT plugin, but when I do load it, I'm unable to start the server.
I was wondering if anyone can guide me here? Is there an API that can help me? And I'm very confused about RabbitMQ. I've been able to load other plugins easily,like stomp, management utilities etc.
I'm 100% sure it is doable. I am doing it right now with robomq.io broker. One cause could be sometimes bugs in your client library restrict you doing so.
Another thing you should be aware of is that internally, RabbitMQ MQTT adapter is mapped into amq.topic exchange by default, so on your STOMP peer, you should subscribe or send to /topic/yourTopic; on your AMQP peer, bind your queue to amq.topic exchange or publish to that exchange.
Follow this example code and documentation to build your client.
If you can't figure out your server, just get a free trial from robomq.io. It saves you time and money.
The development tool I am using is robomq.io broker, producers in Python (AMQP library: pika, MQTT library: paho, STOMP library: stompest), consumer in Node.js (library: amqplib).
Hope it helps!
Well, I'm not sure if this question should be taken down. But if it has to be I leave it to the discretion of the moderators and the stackOverflow community in general.
btw, I use Ubuntu 14.04.
About the RabbitMQ broker
So Mosquitto was running un the background occupying the port 1883 normally used for MQTT. I could have changed the port for RabbitMQ, but decided against it and tried to kill the Mosquitto process. But for some reason, I could NOT.
For now, my quick fix was removing Mosquitto completely and this freed the port, enabling RabbitMQ to use it.
About the protocols
I've used Paho and the RabbitMQ libraries provided to code out simple programs that can publish and receive messages in AMQP/MQTT via the RabbitMQ broker.
(My Googling needs to be better!)
Still haven't converted one to the other. But that shouldn't be too big a step to achieve.
Still would be nice to know if there's an API or something that can help me achieve the conversion in a very simple manner. Of course, if there's not, I'll figure it out ASAP
Any suggestions/comments are heartily welcome. I'm brand new to all this and could really use advice from all you seasoned pros :)
I've searched a lot on Google or directly on Stackoverflow and I know that AMQP's timestamp message property must be filled by the producer.
But I want to know if there is some plugin that writes out on this parameter based on the broker's local timestamp automatic when the message is putted on each queue by a topic exchange.
I'm on a situation that neither producer's nor consumer's timestamps are reliable. Only the broker has a trustworthy watch.
I'm not an Erlang programmer but, if there is no known plugin to do that, I need some help. How could I start to write it myself?
I just need to:
Publish some message by someone who doesn't rely on his local timestamp.
Put this message on each queue mapped on my broker's topic exchange (with it's local timestamp, now I need only this step)
Finally, anyone for whom this message was addressed to is able to get the message and see the exact time this message landed on the broker.
I'm using RabbitMQ 3.3.4, Erlang R16B03, on an Ubuntu's new Amazon AWS machine.
Thanks
First try official Plugin Development Guide. Also look through official and community plugins and their sources. In addition you can always googled any other rabbitmq plugins not listed in lists above. Finally, there are official RabbitMQ mailing list on google groups (replaced http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss).
Recently upgraded to RabbitMQ version 3.2.0 from 2.x previously. The version of pika being used is 0.9.13. Previously when sending "large" messages (20k - 40k bytes...so maybe not that large) it would send the message without any problems. Now with the new RabbitMQ server the message will not send and instead hangs at basic_publish and will not send the message to the server; small messages do not seem to be an issue.
This is causing some frustration because the only thing that has changed is effectively upgrading the server to a newer version.
I noticed that RabbitMQ states on their site that a limit to frame_max size is now set by default. I tried changing my /etc/rabbitmq/rabbit.config file to eliminate the frame_max:
[{rabbit, [{frame_max ,0 }]}].
Then of course restart the service:
service rabbitmq-server restart
I was able to verify this change by using:
rabbitmqctl environment
This did not solve my issue however as the same problem still persists; I can't send large messages to my rabbitmq server. Any ideas on what might be wrong?
The problem, found by the OP himself, was solved by upgrading to pika 0.9.14.
I noticed that my answer in my question was deleted so here is the resolution:
I had to upgrade to pika 0.9.14 ; this solved my problem. There were some issues of compatibility with pika 0.9.13 and a recent upgrade to rabbitmq version 3+
This version of pika can be found here
We have an issue with a windows service which uses nServiceBus. At some random moment, the nServiceBus stops processing messages and direct them directly to Error queue, and I have to restart the service. After the restart, the messages arrived in the input message queue are handled, and everything gets back to normal. If we re-drop the messages which were went to error queue, it is processing it successfully without any issue.
We are using log4net logs to audit the message flow and storing in DB. The NServiceBus Handler stops to log in log4net. After we restart the windows service (NServiceBus) then it start to log again. We are NOT able to redproduce this issue in development environment. We are suspecting this could be a NService Bus Memory Leak issue. But we don't know how to confirm this issue and resolve the same.
We are planning to move this Windows Service (NServiceBus) to different server as a trial and error basis. Did anyone face this issue ever and resolved it? Please help us to resolve this issue as it is causing more troubles in Production environment.
NServiceBus Version that we are using : 2.0.0.1329
Message queue and windows service are in the same machine.
I believe you're running on a version of NServiceBus that is about 5 years old and is no longer supported. While I could give you the standard recommendation of upgrading to a more current release, it could very well be that some of the configuration APIs that you're using have been made obsolete so you may need to make some modifications there and/or in the app.configs.
I'm sorry to say that there probably isn't a better solution for you at this time.
In general, I'd suggest trying to track the NServiceBus releases somewhat more closely. If you're within 6-12 months of the current release, you should generally be in good shape.