@nam088/nestjs-rabbitmq
Version:
A comprehensive RabbitMQ module for NestJS with decorator-based message handling
50 lines (49 loc) • 1.44 kB
TypeScript
export declare enum ServiceDiscoveryEventType {
SERVICE_DEREGISTERED = "service.deregistered",
SERVICE_HEALTHY = "service.healthy",
SERVICE_HEARTBEAT = "service.heartbeat",
SERVICE_REGISTERED = "service.registered",
SERVICE_UNHEALTHY = "service.unhealthy"
}
export interface ServiceDiscoveryEvent {
service: ServiceInfo;
timestamp: Date;
type: ServiceDiscoveryEventType;
}
export interface ServiceDiscoveryOptions {
deregistrationRoutingKey?: string;
discoveryExchange?: string;
enabled?: boolean;
healthCheckEndpoint?: string;
heartbeatInterval?: number;
heartbeatRoutingKey?: string;
host?: string;
logLevel?: 'debug' | 'error' | 'log' | 'none' | 'warn';
metadata?: Record<string, any>;
port?: number;
registrationRoutingKey?: string;
serviceName?: string;
serviceTimeout?: number;
tags?: string[];
version?: string;
}
export interface ServiceFilterOptions {
metadata?: Record<string, any>;
serviceName?: string;
status?: 'healthy' | 'unhealthy' | 'unknown';
tags?: string[];
version?: string;
}
export interface ServiceInfo {
healthCheckEndpoint?: string;
host: string;
lastHeartbeat: Date;
metadata?: Record<string, any>;
port?: number;
registeredAt: Date;
serviceId: string;
serviceName: string;
status: 'healthy' | 'unhealthy' | 'unknown';
tags?: string[];
version: string;
}