Rabbitmq The message can‘t be delivered from the switch to the queue - rabbitmq

Today, I found that the messages of our project could not be pushed normally. After checking the print message log, I learned that the original message was lost when the switch sent it to the queue, and the message could not be sent to the message queue normally.Below is the error message returned by ReturnCallback:
replyCode= 312 , replyText= NO_ROUTE
I am sure that the queue exists and is bound to the switch, I'm confused why this happens

Related

does VM listener consumes the payload from the VM published queue?

when we are adding vm listener in our flow with particular queue name, does that means the message is being consumed already? if anything in the listener flow goes wrong, will that message be still there if we have added the queue as persistent?
The message is consumed from the queue by the listener. If the flow is started, the message has been already consumed.
Persistent is related to where the queue is stored before the message is consumed. As I said, if the message is in the flow, it is already removed from the queue. The exception is if you use transactions. Then the message will be consumed when the transaction ends, or not consumed if there is an error.

Spring cloud Stream not throwing exception

I am using spring cloud stream with rabbitMQ.
I am trying to do the negative test by deleting the queue on runtime and post the message to the deleted queue.
source.queue2Source().send(MessageBuilder.withPayload(queue4DTO).build());
I am listening message from queue 1 and posting the message to queue 2( deleted one). I was expecting that above code will throw an exception but it is not. Even the message from reading from queue 1 has been acknowledged. I have a dead letter queue on queue 1 and queue 2 but message not went into dlq.
That is because the you are sending message to a channel defined by the Source. The channel actually does exist and is bridged via AMQPOutboundChannelAdapter to an exchange which by default will drop undeliverable messages.

How to requeue messages that never get nacked due to network failure?

If a Rabbit MQ consumer receives a message from a queue that has manual acknowledgement but the message gets lost somehow (never gets acked or nacked), is there a way to set a time before the message gets automatically requeued?
This is done immediately, also that's the only thing that makes sense.
The messages remain in the queue until they are ACKed, or until message TTL expires.

why RabbitMQ shows activity on Message rates but not on Queued messages?

I have this issue, I want to know my rabbit is working great.
I am not gonna send the message, so, Im not 100% sure is being sent correctly. But the problem is this.
After all is configured and all....
I see at the RabbitMQ web manager
And when I supposedly send a message the I see activity on the "message rates" chart but nothing at the "queued messages" .
I frankly dont know whats going on, is it too fast that doesnt need to queue the messages? Or something is misconfigured?
Any idea of the difference?
Thanks.
In case RabbitMQ receive non-routable message it drop it. So while message was received, it was not queued.
You may configure Alternate Exchanges to catch such messages.
In my case,
Situation1:
when my Exchange in rabbitTemplate.convertAndSend was not set properly -- the message was not sent to the correct queue -- the Queued messages was empty all time.
however, Message rates is not zero, it does show there are message get sent.
Which correspond to what the other answer is saying:
In case RabbitMQ receive non-routable message it drop it.
Situation2:
when my Exchange in rabbitTemplate.convertAndSend was indeed set properly -- the message was sent to the correct queue -- the Queued messages was queuing up the message.
Everything seems fine.
Situation3:
(continue from Situation2)
And now, I turn on the receiver service which has the #RabbitListener.
The Queued messages immediately drops down to 0, and never goes up again.
But the transporting of messages is still working fine.
Situation4:
(continue from Situation2)
And now, I change the receiver service to use the rabbitTemplate.receiveAndConvert.
Which I manually receive the message from the queue every 2s by using a loop.
(message is also sent from sender service every 2s by using a loop, same as the situations before.)
Now, the Queued messages stays at constant -- a straight line
(depends on how many message you have queued up, in my case 1, before the receiver service is up, then it stays at 1).
Conclusion:
I suspect that, when the message is consumed too fast, the Queued messages will just show 0.
Which correspond to what the OP is saying:
is it too fast that doesnt need to queue the messages?
(or, I could screw up some setting in RabbitMQ and led to wrong conclusion. I dont think so, but idk, I am not familiar with RabbitMQ.)

what happens when mq_send is called on a PEND+S task?

In Vxworks OS what will happen if we call a mq_send function to send a message to the destination task which is already in Pended+suspended state ?
Will it block on mq_send , say property of the msq_queue is set as BLOCKING.
As far as I know the message will be added to the message queue buffer until the destination task comes and picks up the message. The messages will keep on adding to the message queue until it becomes full Once the message queue is full then the sending task will be blocked based on the option which has been set for the Message queue.