xk6-amqp icon indicating copy to clipboard operation
xk6-amqp copied to clipboard

replyTo not being passed in publish

Open aujamo44 opened this issue 2 years ago • 1 comments

When calling amqp.publish() I am receiving an error from RabbitMQ that my message is missing the reply_to property. Here is what I have as my publisher:

const publish = function () {
    amqp.publish({
      queue_name: queueName,
      body: myBody,
      replyTo: myReplyQueue,
      messageId: uniqueID,
      correlationId: uniqueID,
      content_type: "text/plain",
    });
  };

publish()

I have also tried passing the publish option as reply_to and ReplyTo but to no avail 🥲

aujamo44 avatar Jul 25 '23 20:07 aujamo44

Hello @aujamo44! I'm not able to reproduce your issue with the latest source.

When providing as replyTo, the value is not published. I noticed that your messageId and correlationId would have the same issue as replyTo.

Please try again with the latest code and use the following:

const publish = function () {
    amqp.publish({
      queue_name: queueName,
      body: myBody,
      reply_to: myReplyQueue,
      message_id: uniqueID,
      correlation_id: uniqueID,
      content_type: "text/plain",
    });
  };

publish()

Please let me know your results!

javaducky avatar Aug 03 '23 19:08 javaducky