Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't see any chart movements and other metrics #7

Closed
abhagsain opened this issue Dec 6, 2021 · 7 comments
Closed

don't see any chart movements and other metrics #7

abhagsain opened this issue Dec 6, 2021 · 7 comments

Comments

@abhagsain
Copy link

version - 5.0.0

Hi, @weyoss
First of all thanks for buildingredis-smq. Didn't want the overhead of RabbitMQ, or Kafka, and redis-smq is perfect for my use case.

The issue is I'm not seeing chart movement and other metrics.
Not sure if I'm doing something wrong.

The app is inside a docker container and I'm using Nginx as a proxy.

image

Here's the demo code

  const config = {
    namespace: "price-service",
    redis: {
      client: RedisClientName.IOREDIS,
      options: { host: "redis-service", port: 6379, url: "redis-service" },
    },
    monitor: {
      enabled: true,
      port: 4003,
    },
  }


const producer = new Producer("test", config);

  producer.produceMessage(new Message().setBody(response), console.log);

   class TestQueueConsumer extends Consumer {
    consume(message, cb) {
      // console.log("Got a message to consume:", message);
      cb();
    }
  }

  const consumer = new TestQueueConsumer("test", config);
  consumer.run()

To put data

setInterval(() => {
    for (let i = 0; i < 10000; i++) {
      producer.produceMessage(new Message().setBody({ count: i }), console.log);
    }
  }, 1000)

@abhagsain
Copy link
Author

My bad, There was a version mismatch. Chart is working fine.
However when I click on the Acknowledged messages the server sends 500

image
image

@weyoss
Copy link
Owner

weyoss commented Dec 6, 2021

hey @abhagsain

I have just checked the Web UI and it is working correctly:

Screen Shot 2021-12-06 at 21 59 25

I guess you have upgraded your installation from v2 to v5. Major versions can be sometimes incompatible with each other, and that is normal.

Before upgrading to a major version, as a good practice, you should always clean up your Redis server.

I highly suspect that you have a data incompatibility issue between different versions of RedisSMQ. Please shutdown RedisSMQ (consumers, producers, monitors) and run redis-cli flushall from a terminal. If you have any important data, make a backup first.

Also make sure to run the same RedisSMQ version from all your docker containers.

@abhagsain
Copy link
Author

Hi, @weyoss

I tried flushing multiple times, ran only producer to see the pending message but still no luck 😢

image
image

I turned on the logs and got this error. Please take a look

{
   "name":"monitor-server",
   "hostname":"258f57eeed6d",
   "pid":140,
   "level":50,
   "err":{
      "message":"(0 , class_transformer_1.plainToClass) is not a function",
      "name":"TypeError",
      "stack":"TypeError: (0 , class_transformer_1.plainToClass) is not a function\n    at /app/price-service/node_modules/redis-smq/src/monitor-server/utils/validate-dto.ts:8:30\n    at Generator.next (<anonymous>)\n    at /app/price-service/node_modules/redis-smq/dist/src/monitor-server/utils/validate-dto.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/app/price-service/node_modules/redis-smq/dist/src/monitor-server/utils/validate-dto.js:4:12)\n    at validateDTO (/app/price-service/node_modules/redis-smq/dist/src/monitor-server/utils/validate-dto.js:16:12)\n    at /app/price-service/node_modules/redis-smq/src/monitor-server/middlewares/request-validator.ts:30:38\n    at Generator.next (<anonymous>)\n    at /app/price-service/node_modules/redis-smq/dist/src/monitor-server/middlewares/request-validator.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/app/price-service/node_modules/redis-smq/dist/src/monitor-server/middlewares/request-validator.js:4:12)\n    at /app/price-service/node_modules/redis-smq/src/monitor-server/middlewares/request-validator.ts:10:30\n    at dispatch (/app/price-service/node_modules/koa-compose/index.js:42:32)\n    at /app/price-service/node_modules/@koa/router/lib/router.js:372:16\n    at dispatch (/app/price-service/node_modules/koa-compose/index.js:42:32)\n    at allowedMethods (/app/price-service/node_modules/@koa/router/lib/router.js:433:12)\n    at dispatch (/app/price-service/node_modules/koa-compose/index.js:42:32)\n    at /app/price-service/node_modules/@koa/router/lib/router.js:372:16\n    at dispatch (/app/price-service/node_modules/koa-compose/index.js:42:32)\n    at /app/price-service/node_modules/koa-compose/index.js:34:12\n    at dispatch (/app/price-service/node_modules/@koa/router/lib/router.js:377:31)\n    at dispatch (/app/price-service/node_modules/koa-compose/index.js:42:32)"
   },
   "msg":"(0 , class_transformer_1.plainToClass) is not a function",
   "time":"2021-12-07T02:37:38.062Z",
   "v":0
}

@weyoss
Copy link
Owner

weyoss commented Dec 7, 2021

@abhagsain

It is an error coming from class-transformer package which is used by redis-smq.

RedisSMQ has been tested against [email protected] but at the time when you installed redis-smq [email protected] was downloaded instead of [email protected]. This occurred because package.json is using "class-transformer": "^0.4.0".

[email protected] is faulty. See typestack/class-validator#1411.

I am going to fix this issue ASAP.

@weyoss
Copy link
Owner

weyoss commented Dec 7, 2021

This issue has been fixed.

Please upgrade redis-smq to the latest version (currently v5.0.11).

@abhagsain
Copy link
Author

Yes, it's working now 🎊
You can close this.

Thank you so much @weyoss

@weyoss
Copy link
Owner

weyoss commented Dec 8, 2021

Closing as resolved.

@weyoss weyoss closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants