curated-node
Version:
Not a framework. Not a module. Just a bunch of Node.js packages you most likely familiar with and probably already use, bundled together in a modular fashion.
35 lines (34 loc) • 1.24 kB
TypeScript
import * as Amqp from "@droidsolutions-oss/amqp-ts";
import { LogModuleConfig, LogModule } from "./Log";
import { _BaseModule } from "../_BaseModule";
export declare type RabbitMQModuleConfig = {
id?: string;
logger?: LogModuleConfig;
scheme?: "amqp" | "amqps";
options: {
host: string;
port: number;
user: string;
password: string;
};
};
export declare class RabbitMQModule extends _BaseModule<RabbitMQModule, RabbitMQModuleConfig> {
private readonly _connection;
private readonly _url;
private readonly _queues;
constructor(config: RabbitMQModuleConfig, logger?: LogModule);
destroy(): Promise<unknown>;
get connection(): Amqp.Connection;
get queues(): {
[key: string]: Amqp.Queue;
};
getQueue(queueName: string, queueOptions?: {
[key: string]: any;
}): Promise<Amqp.Queue>;
sendToQueue(queueName: string, rawMsg: any, msgOptions?: {
[key: string]: any;
}): Promise<Amqp.Message>;
consumeQueue(queueName: string, consumerFn: (msg: Amqp.Message) => any, consumerOptions?: {
[key: string]: any;
}): Promise<import("@droidsolutions-oss/amqp-ts/lib/Queue/StartConsumerResult").StartConsumerResult>;
}