Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No delivery mode option on AmqpConnection.request method #719

Closed
cs-salim opened this issue Apr 8, 2024 · 2 comments
Closed

No delivery mode option on AmqpConnection.request method #719

cs-salim opened this issue Apr 8, 2024 · 2 comments
Labels
enhancement New feature or request rabbitmq

Comments

@cs-salim
Copy link

cs-salim commented Apr 8, 2024

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
Copy link
Contributor

@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
Copy link
Contributor

davidmwhynot commented Apr 15, 2024

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.

underfisk pushed a commit that referenced this issue Apr 15, 2024
…hem in AmqpConnection.request (#723)

Added a new property named "publishOptions" to the RequestOptions interface so that the additional
options available in the amqplib's Options.Publish interface can be provided when making rpc
requests. Added said usage of the new property to the AmqpConnection.request method's call to
this.publish.

re #719
WonderPanda pushed a commit that referenced this issue Apr 15, 2024
…nection.request (#723)

Added a new property named "publishOptions" to the RequestOptions interface so that the additional
options available in the amqplib's Options.Publish interface can be provided when making rpc
requests. Added said usage of the new property to the AmqpConnection.request method's call to
this.publish.

re #719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rabbitmq
Projects
None yet
Development

No branches or pull requests

3 participants