Azure / azure-service-bus-java

☁️ Java client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
MIT License
60 stars 59 forks source link

CoreMessageReceiver.returnMesagesLoopDaemon is being executed too often causing higher CPU consumption #405

Open ertwroc opened 4 years ago

ertwroc commented 4 years ago

Actual Behavior

CoreMessageReceiver.returnMesagesLoopDaemon is scheduled to be executed every millisecond even if there are neither prefetched messages nor pending receivers, causing unnecessary higher CPU usage.

Expected Behavior

Solution to this could be to use blocking queue and its take() method or poll(time, unit) instead of poll() for prefetchedMessages and pendingReceives collections.

Versions