mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
34 lines
609 B
TypeScript
34 lines
609 B
TypeScript
import { BaseRpcContext } from './base-rpc.context';
|
|
|
|
type RmqContextArgs = [Record<string, any>, any, string];
|
|
|
|
/**
|
|
* @publicApi
|
|
*/
|
|
export class RmqContext extends BaseRpcContext<RmqContextArgs> {
|
|
constructor(args: RmqContextArgs) {
|
|
super(args);
|
|
}
|
|
|
|
/**
|
|
* Returns the original message (with properties, fields, and content).
|
|
*/
|
|
getMessage() {
|
|
return this.args[0];
|
|
}
|
|
|
|
/**
|
|
* Returns the reference to the original RMQ channel.
|
|
*/
|
|
getChannelRef() {
|
|
return this.args[1];
|
|
}
|
|
|
|
/**
|
|
* Returns the name of the pattern.
|
|
*/
|
|
getPattern() {
|
|
return this.args[2];
|
|
}
|
|
}
|