golevelup / nestjs

A collection of badass modules and utilities to help you level up your NestJS applications 🚀
MIT License
2.16k stars 244 forks source link

No delivery mode option on AmqpConnection.request method #719

Open cs-salim opened 3 months ago

cs-salim commented 3 months ago

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?

underfisk commented 3 months ago

@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

davidmwhynot commented 3 months ago

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.