UNPKG

@midwayjs/rabbitmq

Version:

Midway Framework for rabbitmq

30 lines 1.4 kB
/** * This RabbitMQ Server changed from https://github.com/JeniTurtle/egg-rabbitmq-plus/blob/master/rabbitmq.ts */ import * as amqp from 'amqp-connection-manager'; import { IRabbitMQApplication } from './interface'; import { ConsumeMessage } from 'amqplib/properties'; import { RabbitMQListenerOptions, ILogger, MidwayTraceService } from '@midwayjs/core'; import type { Channel } from 'amqplib'; import { EventEmitter } from 'events'; export declare class RabbitMQServer extends EventEmitter implements IRabbitMQApplication { protected channelManagerSet: Set<Channel>; protected connection: amqp.AmqpConnectionManager; protected logger: ILogger; protected traceService: MidwayTraceService; protected traceEnabled: boolean; protected traceInjector: (args: { request?: unknown; custom?: Record<string, unknown>; }) => any; protected reconnectTime: any; constructor(options?: any); bindError(): void; createChannel(isConfirmChannel?: boolean): Promise<any>; private bindTraceContext; connect(url: any, socketOptions: any): Promise<void>; createConsumer(listenerOptions: RabbitMQListenerOptions, listenerCallback: (msg: ConsumeMessage | null, channel: Channel, channelWrapper: any) => Promise<void>): Promise<void>; protected closeConnection(): Promise<void>; close(): Promise<void>; } //# sourceMappingURL=mq.d.ts.map