Closed davidmwhynot closed 3 months ago
This could also have been done like so:
export interface RequestOptions extends Omit<Options.Publish, 'replyTo'> {
exchange: string;
routingKey: string;
timeout?: number;
payload?: any;
}
// usage in AmqpConnection.request:
await this.publish(
requestOptions.exchange,
requestOptions.routingKey,
payload,
{
...requestOptions,
replyTo: DIRECT_REPLY_QUEUE,
correlationId,
}
);
however, I did not want to pollute the existing RequestOptions
interface with the relatively large number of additional options on the amqplib
's Options.Publish
interface.
I'm will to adjust to this style if it's preferred over the current change.
Published as @golevelup/nestjs-rabbitmq@5.3.0
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