UNPKG

1.62 kBTypeScriptView Raw
1import { RmqContext } from '../ctx-host';
2import { Transport } from '../enums';
3import { RmqUrl } from '../external/rmq-url.interface';
4import { CustomTransportStrategy, RmqOptions } from '../interfaces';
5import { ReadPacket } from '../interfaces/packet.interface';
6import { Server } from './server';
7/**
8 * @publicApi
9 */
10export declare class ServerRMQ extends Server implements CustomTransportStrategy {
11 protected readonly options: RmqOptions['options'];
12 readonly transportId = Transport.RMQ;
13 protected server: any;
14 protected channel: any;
15 protected connectionAttempts: number;
16 protected readonly urls: string[] | RmqUrl[];
17 protected readonly queue: string;
18 protected readonly prefetchCount: number;
19 protected readonly noAck: boolean;
20 protected readonly queueOptions: any;
21 protected readonly isGlobalPrefetchCount: boolean;
22 protected readonly noAssert: boolean;
23 constructor(options: RmqOptions['options']);
24 listen(callback: (err?: unknown, ...optionalParams: unknown[]) => void): Promise<void>;
25 close(): void;
26 start(callback?: (err?: unknown, ...optionalParams: unknown[]) => void): Promise<void>;
27 createClient<T = any>(): T;
28 setupChannel(channel: any, callback: Function): Promise<void>;
29 handleMessage(message: Record<string, any>, channel: any): Promise<void>;
30 handleEvent(pattern: string, packet: ReadPacket, context: RmqContext): Promise<any>;
31 sendMessage<T = any>(message: T, replyTo: any, correlationId: string): void;
32 protected initializeSerializer(options: RmqOptions['options']): void;
33 private parseMessageContent;
34}