node-ts/bus

Rabbitmq transport polling

blankley opened this issue · 2 comments

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 :

Screenshot from 2022-03-11 10-01-06

I added a:

await new Promise(r => setTimeout(r,1000))

to

and see the expected 1 Get a second and normal CPU usage:
Screenshot from 2022-03-11 13-07-35

Are we making a mistake in implementation? Missing something else?

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?