golevelup / nestjs

A collection of badass modules and utilities to help you level up your NestJS applications 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No delivery mode option on AmqpConnection.request method

cs-salim opened this issue · 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 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

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.