Skip to content

Commit

Permalink
feat(rabbitmq): add correlationId to request
Browse files Browse the repository at this point in the history
  • Loading branch information
zerobig authored and WonderPanda committed Mar 26, 2020
1 parent c20ba1b commit 81cd0ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rabbitmq/src/amqp/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class AmqpConnection {
public async request<T extends {}>(
requestOptions: RequestOptions
): Promise<T> {
const correlationId = uuid.v4();
const correlationId = requestOptions.correlationId || uuid.v4();
const timeout = requestOptions.timeout || this.config.defaultRpcTimeout;
const payload = requestOptions.payload || {};

Expand Down
1 change: 1 addition & 0 deletions packages/rabbitmq/src/rabbitmq.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface MessageOptions {
export interface RequestOptions {
exchange: string;
routingKey: string;
correlationId?: string;
timeout?: number;
payload?: any;
}
Expand Down

0 comments on commit 81cd0ac

Please sign in to comment.