@Override public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { Subscription sub = consumerExchange.getSubscription(); if (sub == null) { sub = subscriptions.get(ack.getConsumerId()); if (sub == null) { if (!consumerExchange.getConnectionContext().isInRecoveryMode()) { LOG.warn("Ack for non existent subscription, ack: {}", ack); throw new IllegalArgumentException("The subscription does not exist: " + ack.getConsumerId()); } else { LOG.debug("Ack for non existent subscription in recovery, ack: {}", ack); return; } } consumerExchange.setSubscription(sub); } sub.acknowledge(consumerExchange.getConnectionContext(), ack); }
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId());
producerExchange.incrementSend(); final boolean sendProducerAck = !message.isResponseRequired() && producerInfo.getWindowSize() > 0 && !context.isInRecoveryMode();
@Override public void run() { try { // While waiting for space to free up... the // message may have expired. if (message.isExpired()) { broker.messageExpired(context, message, null); getDestinationStatistics().getExpired().increment(); } else { doMessageSend(producerExchange, message); } if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message .getSize()); context.getConnection().dispatchAsync(ack); } else { Response response = new Response(); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } catch (Exception e) { if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } } });
&& !context.isInRecoveryMode(); if (message.isExpired()) {
@Override public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { Subscription sub = consumerExchange.getSubscription(); if (sub == null) { sub = subscriptions.get(ack.getConsumerId()); if (sub == null) { if (!consumerExchange.getConnectionContext().isInRecoveryMode()) { LOG.warn("Ack for non existent subscription, ack: {}", ack); throw new IllegalArgumentException("The subscription does not exist: " + ack.getConsumerId()); } else { LOG.debug("Ack for non existent subscription in recovery, ack: {}", ack); return; } } consumerExchange.setSubscription(sub); } sub.acknowledge(consumerExchange.getConnectionContext(), ack); }
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { Subscription sub = consumerExchange.getSubscription(); if (sub == null) { sub = subscriptions.get(ack.getConsumerId()); if (sub == null) { if (!consumerExchange.getConnectionContext().isInRecoveryMode()) { LOG.warn("Ack for non existent subscription, ack:" + ack); throw new IllegalArgumentException("The subscription does not exist: " + ack.getConsumerId()); } else { LOG.debug("Ack for non existent subscription in recovery, ack:" + ack); return; } } consumerExchange.setSubscription(sub); } sub.acknowledge(consumerExchange.getConnectionContext(), ack); }
@Override public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { Subscription sub = consumerExchange.getSubscription(); if (sub == null) { sub = subscriptions.get(ack.getConsumerId()); if (sub == null) { if (!consumerExchange.getConnectionContext().isInRecoveryMode()) { LOG.warn("Ack for non existent subscription, ack: {}", ack); throw new IllegalArgumentException("The subscription does not exist: " + ack.getConsumerId()); } else { LOG.debug("Ack for non existent subscription in recovery, ack: {}", ack); return; } } consumerExchange.setSubscription(sub); } sub.acknowledge(consumerExchange.getConnectionContext(), ack); }
@Override public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { Subscription sub = consumerExchange.getSubscription(); if (sub == null) { sub = subscriptions.get(ack.getConsumerId()); if (sub == null) { if (!consumerExchange.getConnectionContext().isInRecoveryMode()) { LOG.warn("Ack for non existent subscription, ack: {}", ack); throw new IllegalArgumentException("The subscription does not exist: " + ack.getConsumerId()); } else { LOG.debug("Ack for non existent subscription in recovery, ack: {}", ack); return; } } consumerExchange.setSubscription(sub); } sub.acknowledge(consumerExchange.getConnectionContext(), ack); }
if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId());
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId());
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId());
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId());
@Override public void run() { try { // While waiting for space to free up... the // message may have expired. if (message.isExpired()) { broker.messageExpired(context, message, null); getDestinationStatistics().getExpired().increment(); } else { doMessageSend(producerExchange, message); } if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message .getSize()); context.getConnection().dispatchAsync(ack); } else { Response response = new Response(); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } catch (Exception e) { if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } } });
public void run() { try { // While waiting for space to free up... the // message may have expired. if (message.isExpired()) { broker.messageExpired(context, message, null); getDestinationStatistics().getExpired().increment(); } else { doMessageSend(producerExchange, message); } if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message .getSize()); context.getConnection().dispatchAsync(ack); } else { Response response = new Response(); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } catch (Exception e) { if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } } });
@Override public void run() { try { // While waiting for space to free up... the // message may have expired. if (message.isExpired()) { broker.messageExpired(context, message, null); getDestinationStatistics().getExpired().increment(); } else { doMessageSend(producerExchange, message); } if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message .getSize()); context.getConnection().dispatchAsync(ack); } else { Response response = new Response(); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } catch (Exception e) { if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } } });
@Override public void run() { try { // While waiting for space to free up... the // message may have expired. if (message.isExpired()) { broker.messageExpired(context, message, null); getDestinationStatistics().getExpired().increment(); } else { doMessageSend(producerExchange, message); } if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message .getSize()); context.getConnection().dispatchAsync(ack); } else { Response response = new Response(); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } catch (Exception e) { if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } } });
producerExchange.incrementSend(); final boolean sendProducerAck = !message.isResponseRequired() && producerInfo.getWindowSize() > 0 && !context.isInRecoveryMode();
producerExchange.incrementSend(); final boolean sendProducerAck = !message.isResponseRequired() && producerInfo.getWindowSize() > 0 && !context.isInRecoveryMode();
&& !context.isInRecoveryMode(); if (message.isExpired()) {