ARTEMIS-2146 Avoiding NPE on AMQP Flow Control
AMQP Flow control will disable consumer flow control (setting credits to null) This will avoid a race checking flow control.
This commit is contained in:
parent
23cc4f45ce
commit
5132775371
|
@ -349,7 +349,9 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HandleStatus handle(final MessageReference ref) throws Exception {
|
public HandleStatus handle(final MessageReference ref) throws Exception {
|
||||||
if (callback != null && !callback.hasCredits(this) || availableCredits != null && availableCredits.get() <= 0) {
|
// available credits can be set back to null with a flow control option.
|
||||||
|
AtomicInteger checkInteger = availableCredits;
|
||||||
|
if (callback != null && !callback.hasCredits(this) || checkInteger != null && checkInteger.get() <= 0) {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug(this + " is busy for the lack of credits. Current credits = " +
|
logger.debug(this + " is busy for the lack of credits. Current credits = " +
|
||||||
availableCredits +
|
availableCredits +
|
||||||
|
|
Loading…
Reference in New Issue