Closed blankley closed 2 years ago
thanks for finding that @blankley . I've pushed a change that internally uses callbacks rather than loops that should be much easier on your CPU.
This fix is available in the latest @node-ts/bus-core
and @node-ts/bus-rabbitmq
Thanks! Great fix. Not to sound ungrateful, but would it be possible to back port this to the 0.6.x tree?
We're using rabbitmq as a transport and seeing very high cpu usage. We can see over 12k Gets a second and it looks like we're polling rabbit with no timeout :
I added a:
await new Promise(r => setTimeout(r,1000))
to
https://github.com/node-ts/bus/blob/f3843df389351f66c3cc4ecaacd939bca70ec93c/packages/bus-rabbitmq/src/rabbitmq-transport.ts#L97
and see the expected 1 Get a second and normal CPU usage:
Are we making a mistake in implementation? Missing something else?