We are using vertx.eventBus().publish() method from APIs for GET , POST , PATCH , PUT calls. This method consumer is only pushing the data to cache [ we are using HazleCast cache ]. So this consumer is being called from all the APIs [ highly throttled ]
While running this under perf testing , this is causing thread delay issue for Vertx and we notice this as CPU is getting higher at that time as well. This happens for few seconds , then everything coming back to normal state , then it happens again after sometime.
After investigation, this method [ i.e. consumer method for vertx publish event ] is showing up as bottleneck and showing highest time taking method during this intermittent spike.
After reading much documentation, I found this as below.
Internally, Vert.x has Netty schedule another call to the consumer, which will not run until the current invocation (and any other methods scheduled ahead of it on the Netty event loop) complete.
Can you please suggest on this, it looks like vertx.eventBus().publish method should not be used for consuming it inside same application and not a good approach.