nestjs icon indicating copy to clipboard operation
nestjs copied to clipboard

No delivery mode option on AmqpConnection.request method

Open cs-salim opened this issue 10 months ago • 2 comments

AmqpConnection.request calls publish with a set list of parameters: https://github.com/golevelup/nestjs/blob/master/packages/rabbitmq/src/amqp/connection.ts#L402

await this.publish(
      requestOptions.exchange,
      requestOptions.routingKey,
      payload,
      {
        replyTo: DIRECT_REPLY_QUEUE,
        correlationId,
        headers: requestOptions.headers,
        expiration: requestOptions.expiration,
      }
    );

Which doesn't let you pass other request options like delivery mode. Is this intended as a design choice or is it a bug?

cs-salim avatar Apr 08 '24 22:04 cs-salim

@cs-salim It was the bare minimum setup back then, we could call it intentional/design choice but if you need to extend the available options, feel free to fill a PR that receives the partial options instead of manually pass one by one

underfisk avatar Apr 09 '24 14:04 underfisk

I opened a PR (#723) to address this as I need to provide to the userId option. The PR addresses the use case in this issue as well as my own use case by allowing the entire amqplib's Options.Publish interface to be provided, except for the replyTo option.

davidmwhynot avatar Apr 15 '24 17:04 davidmwhynot