Skip to content

Commit

Permalink
feat(amqp/connection.ts): add publishOptions to RequestOptions; use t…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
davidmwhynot authored Apr 15, 2024
1 parent 3e37d37 commit 3a8d5b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/rabbitmq/src/amqp/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ export class AmqpConnection {
requestOptions.routingKey,
payload,
{
...requestOptions.publishOptions,
replyTo: DIRECT_REPLY_QUEUE,
correlationId,
headers: requestOptions.headers,
Expand Down
4 changes: 4 additions & 0 deletions packages/rabbitmq/src/rabbitmq.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export interface RequestOptions {
payload?: any;
headers?: any;
expiration?: string | number;
publishOptions?: Omit<
Options.Publish,
'replyTo' | 'correlationId' | 'headers' | 'expiration'
>;
}

export interface QueueOptions {
Expand Down

0 comments on commit 3a8d5b3

Please sign in to comment.