Is there any event provided by RabbitMQ or by some plugins which will "fired" when consumer acked message?
The result of event for example can be message to specific queue or webhook.
Any solutions or recomendations?
Expected scenario: there is a queue with messages for client app
- app consumes message from this queue
- app sends lightweight AMQP ack packet
- server receives ack
- server calls some sort of callback (webhook)
This can be easily achieved from the consumer side as well , when you ack the message from the consumer , call the external webhook from the consumer itself. The message body can carry the webhook URL which can then be parsed at the consumer side , this way you will have the flexibility to pass in parameters specific to the message.
Related
I am implementing standard request/response scenario with MT and RabbitMQ. Client is Asp.net core API and consumer is a windows service.
As part of testing the exception cases if I stop the consumer and submit a request from API using request client, since there is no consumer processing, API got request timeout exception which is cool. But the message is sitting in the consumer queue and when I start the consumer, it picks the message and process the stuff( sending the message to external endpoint) and moved to a _skipped queue as there is no request client listening for this message.
Do you think it is correct behavior? First place when the api got request timeout exception, he will retry anyway so what’s the point of processing first message still?
How can I ignore those message where request clients were already finished processing with any error?
Thanks
What you are describing is very common, and I'd recommend reading up on idempotence and other distributed system failure scenarios.
Sending commands (the request, in this case) and conveying outcomes via a timeout in a message-based system can be very misleading. For instance, if you look at the ForkJoint, in the event of a request timeout, the response is actually a 202/Accepted instead of communicating an error.
The message is in the queue, it will be processed, so there is no reason to fail the controller and report an error back to the caller. So an intermediate response is used instead.
The sample is part of MassTransit Season 3 where I discuss a new idiom to deal with eventual completion/failure of commands in distributed systems. There might be some useful examples in there to help you understand the failure scenarios.
As doc sayed, to discard skipped messages so they are not moved to the _skipped queue:
cfg.ReceiveEndpoint("input-queue", ec =>
{
ec.DiscardSkippedMessages();
});
I want to a send message to a specific consumer in RabbitMQ. Do you have a solution?
In RabbitMQ, you cannot send a message to a specific consumer. You maintain a queue for the specific consumer which listens to that queue. Then, you route the message to the queue using a routing key. You can use a exchange which routes the specific message to the specific queue.
I am new to this.I created a jms message store in wso2 esb and sent a message to it.message was received in activeMq but cannot see the message body in Activemq.
Message Details:
org.apache.synapse.message.store.impl.commons.StorableMessage#79f1d1d8
As ESB using jms message stores to store messages as objects, you can't see the message body via activemq. You can use message processor to get messages from the store and then use it in whatever the process you want.
As ESB use message store purely for storing process, it will use exact format. That is why you have to use processors to work with stored messages.
I have a requirement where in (RabbitMQ)server sends the request to the client and client executes the operation and sends the response back to the server.
I would like to know which mechanism to use for this Topic, PubSub, Routing...
Can we create the bi-directional connection like server-client similar to xmpp in rabbit mq, if yes how can we do?
thanks
Lokesh
You can use a Spring AMQP asynchronous consumer with a MessageListenerAdapter to invoke a POJO. See the reference documentation.
If you want more control; use a simple MessageListener and send the reply with a RabbitTemplate.
This test case shows an end-to-end configuration (client side and server side). The client side automatically takes care of setting the correlationId.
I have a web service that:
Uses MSMQ transport.
Is a send-only NSB endpoint.
Uses NSB's message encryption.
Sends to a message queue on another machine.
Is the message encrypted during transport across the network to the message queue on the other machine?
Yes, all properties of type WireEncryptedString on a message are encrypted on the sender endpoint and then decrypted on the receiving endpoint.