Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
publishing message from redis-cli dont get recieved in nest js

i did set up microservice with nestjs and Redis and i did test it from another similar one and it did work but when i want to test it using redis-cli this way

PUBLISH add "message"

or

PUBLISH update "message"

It doesn't work my microservice doesn't receive the message and my setup in nest

import { Controller } from '@nestjs/common';
import { MessagePattern, Payload } from '@nestjs/microservices';
import { WatchersService } from './watchers.service';

import { PostDto } from '../dto/post.dto';

@Controller()
export class WatchersController {
  constructor(private readonly watchersService: WatchersService) {}

  @MessagePattern({ cmd: 'add' })
  up(@Payload() data: PostDto) {
    return this.watchersService.up(data);
  }

  @MessagePattern({ cmd: 'update' })
  down(@Payload() data: PostDto) {
    return this.watchersService.down(data);
  }
}

and that's how I send messages from another microservice

import { Body, Controller, Inject, Post } from '@nestjs/common';
import { ClientProxy } from '@nestjs/microservices';

@Controller()
export class AppController {
  constructor(@Inject('RANDOM_SERVICE') private client: ClientProxy) {}

  @Post('/add')
  deviceUp(@Body() data) {
    return this.client.send({ cmd: 'add' }, data);
  }
  @Post('/update')
  deviceDown(@Body() data) {
    return this.client.send({ cmd: 'update' }, data);
  }
}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!