fear: nats log promihous

This commit is contained in:
mozzie 2023-10-10 21:38:59 +08:00
parent 90a3fd5861
commit 3ba9704741
15 changed files with 90 additions and 56 deletions

View File

@ -27,11 +27,13 @@ import { ForbiddenExceptionFilter } from './filter/forbid.filter';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -8,11 +8,13 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -6,11 +6,13 @@ async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'], // 可以指定链接到多个nats的消息队列
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
);

View File

@ -6,11 +6,13 @@ async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'], // 可以指定链接到多个nats的消息队列
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
);

View File

@ -6,11 +6,13 @@ async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'], // 可以指定链接到多个nats的消息队列
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
);

View File

@ -8,11 +8,13 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -21,11 +21,13 @@ import { AdminModule } from './admin/admin.module';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -6,11 +6,13 @@ async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'], // 可以指定链接到多个nats的消息队列
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
);

View File

@ -6,11 +6,13 @@ async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'], // 可以指定链接到多个nats的消息队列
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
);

View File

@ -7,11 +7,13 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -7,11 +7,13 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -21,11 +21,13 @@ import * as cookieParser from 'cookie-parser';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -7,11 +7,13 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
ClientsModule.register([
{
name: 'Client',
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'],
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
]),

View File

@ -6,11 +6,13 @@ async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
transport: Transport.NATS,
transport: Transport.RMQ,
options: {
servers: ['nats://localhost:4222'], // 可以指定链接到多个nats的消息队列
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
urls: ['amqp://localhost:5672'],
queue: 'cats_queue',
queueOptions: {
durable: false,
},
},
},
);

View File

@ -11,6 +11,12 @@ services:
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
# volumes:
# - rabbitmq-data:/var/lib/rabbitmq
command: >
bash -c "rabbitmq-plugins enable rabbitmq_management &&
rabbitmq-plugins enable rabbitmq_tracing &&
rabbitmq-server"
mongodb:
image: mongo:5.0