I have a producer and broker on the same machine. The manufacturer sends the following messages:
channel = connection.createChannel();
channel.queueDeclare(merchantId, true, false, false, null);
channel.basicPublish("", consumerId, true, false,
MessageProperties.MINIMAL_PERSISTENT_BASIC, "myMessage");
The user is sitting on another machine and listening to messages. It uses explicit confirmation like this:
while (true) {
QueueingConsumer.Delivery delivery = consumer.nextDelivery();
channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
}
From what I understand, ack is for the broker to delete the message.
But how does my producer find out what the consumer sent?
source
share