Request/response process in Nest and RabbitMQ - rabbitmq

I am new in Nest and RabbitMQ. Could you please let me know how to build synchronous request/response process? And so that the producer would return data to consumer while ack.
Producer is awaiting once promise resolved.
I would appreciate for an example.
Thanks in advance

Related

clear messages from rabbitMQ queue in mule 3

My requirement is to clear all the messages from queue before processing the flow or publishing anything in the queue.
We are using rabbitMQ and due to some reason messages are stucked in the queue and because of that we are facing some issue when we are counting the queue based on the messages. so for the next time before processing we have to clear the queue.
Here we have multiple queue like slave1, slave2,slave3 and when api will be triggered in the process section we have to clear the queue.
Kindly suggest how we can do this in mule3.
Mule 3 has a generic AMQP connector. It does not support administrative commands from a specific implementation like RabbitMQ, so you can't use the connector.
You could use RabbitMQ REST API and call it using the HTTP Request connector. See this previous answer to see how to delete queues with Curl, then implement the same request with HTTP Request: https://stackoverflow.com/a/29148299/721855

Can a MQTT Subscriber be able to take concurrently multiple messages of the Same Topic?

I am trying to create a Subscriber in my Spring Boot Application. My objective is that the publisher will send multiple messages to a topic and I have to get those message and process them .I noticed that the "handleMessage" of both Paho and Apache ActiveMq will process 1 message at a time. Is it possible to make it concurrent??
I have tried the following
Replaced Paho with ActiveMq
Provided concurrency in my listenercontainer
Provided prefetch in my subscribe URL
Please let me know if there is any way to make my MQTT subscriber to take multiple messages concurrently.
Thank You
If you supply your own thread pool you can have the handleMessage method pass the incoming message off to the threadpool to process and then pass the next message off to the pool.

Is there any way to tell rabbitMQ resend an unacknowledged message to a worker?

Hi there i have a rabbitMQ queue and just one worker to handle queued messages. I want to know is there any way to tell rabbitMQ if a message is unacknowledged send it again to worker periodically.
Very thanks in advance.
RabbitMQ will consider a message delivered and not yet acknowledged as being consumed. You cannot enforce it to be re-delivered as long as the consumer which fetched it does not close the channel or reject the message via the basic.reject AMQP method.
You can read more about publish/delivery confirmation in the documentation.

Parallel Listening of messages in rabbit mq

We have a requirement, where we create queues in rabbitMq on application startup with direct exchange, and then have to assign a single listener to each queue. We implemented that using Spring AMQP with the following configuration
#Bean(name= {"dispatcherListener"})
public SimpleMessageListenerContainer dispatcherListener() {
SimpleMessageListenerContainer listenerContainer = new SimpleMessageListenerContainer();
listenerContainer.setConnectionFactory(connectionFactory());
listenerContainer.setQueues(participantQueues());
listenerContainer.setMessageConverter(jsonMessageConverter());
listenerContainer.setMessageListener(subscriptionListener);
listenerContainer.setAcknowledgeMode(AcknowledgeMode.AUTO);
listenerContainer.setAutoStartup(false);
return listenerContainer;
}
But then we faced a problem, with the above configuration. When we publish the message to multiple queues , then the listener is reading the messages serially from each queue. But we expected it to listen to messages from each queue independent of other queue parallely.
Can someone please guide me, where i went wrong ?
Any help would be appreciated
That's correct behavior, since the default concurrency is 1, therefore we have only one listener for all queue.
Just consider to increase that value for your configuration.
More info in the Reference Manual.

Message Bridge - How to route messages from topic to queue - Glassfish

Is it possible to configure a message bridge for GlassFish? The message is currently posted to a topic, and customer requirement is to "redirect" this message from a topic to a queue. (both are on the same GlassFish server). By redirect, I mean, the message will be posted on the topic and then copied to the queue. I cannot find much documentation about this, I have read about Open MQ, JMS broker and JMS bridge, but this does not seem to fit this requirement.
I understand, that I can implement a topic subscriber and then post a message to queue. But I would like to know, if it is possible to do this just by configuration or do I have to implement a bridge?
Thanks for your help, I do appreciate it.
Vladi
You'll need to implement a bridge... or change the submitter to submit to both the queue and the topic.