private AMQPConnection_0_8 getConnection() { return _channel.getConnection(); }
@Override public Object getConnectionReference() { return getConnection().getReference(); }
@Override public boolean isClosing() { return _closing.get() || getConnection().isClosing(); }
@Override public void flushBatched() { _channel.getConnection().setDeferFlush(false); }
public NamedAddressSpace getAddressSpace() { return getConnection().getAddressSpace(); }
@Override public synchronized void unblock() { if(_blockingEntities.remove(this)) { if(_blockingEntities.isEmpty() && _blocking.compareAndSet(true,false)) { messageWithSubject(ChannelMessages.FLOW_REMOVED()); getConnection().notifyWork(this); } } }
@Override public synchronized void block() { if(_blockingEntities.add(this)) { if(_blocking.compareAndSet(false,true)) { messageWithSubject(ChannelMessages.FLOW_ENFORCED("** All Queues **")); getConnection().notifyWork(this); } } }
@Override public synchronized void unblock(Queue<?> queue) { if(_blockingEntities.remove(queue)) { if(_blockingEntities.isEmpty() && _blocking.compareAndSet(true,false) && !isClosing()) { messageWithSubject(ChannelMessages.FLOW_REMOVED()); getConnection().notifyWork(this); } } }
@Override public synchronized void block(Queue<?> queue) { if(_blockingEntities.add(queue)) { if(_blocking.compareAndSet(false,true)) { messageWithSubject(ChannelMessages.FLOW_ENFORCED(queue.getName())); getConnection().notifyWork(this); } } }
@Override public void receiveTxSelect() { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] TxSelect"); } ServerTransaction txn = _transaction; if (txn instanceof LocalTransaction) { getConnection().unregisterTransactionTickers(_transaction); } _transaction = _connection.createLocalTransaction(); long notificationRepeatPeriod = getContextValue(Long.class, TRANSACTION_TIMEOUT_NOTIFICATION_REPEAT_PERIOD); getConnection().registerTransactionTickers(_transaction, message -> _connection.sendConnectionCloseAsync(AMQPConnection.CloseReason.TRANSACTION_TIMEOUT, message), notificationRepeatPeriod); MethodRegistry methodRegistry = _connection.getMethodRegistry(); TxSelectOkBody responseBody = methodRegistry.createTxSelectOkBody(); _connection.writeFrame(responseBody.generateFrame(_channelId)); }
public void confirmAutoClose() { ProtocolOutputConverter converter = getChannel().getConnection().getProtocolOutputConverter(); converter.confirmConsumerAutoClose(getChannel().getChannelId(), getConsumerTag()); }
@Override protected void doSendInternal(final MessageInstanceConsumer consumer, final MessageInstance entry, final AMQMessage message, final boolean batch) { // put queue entry on a list and then notify the connection to read list. synchronized (getChannel()) { getChannel().getConnection().setDeferFlush(batch); long deliveryTag = getChannel().getNextDeliveryTag(); addUnacknowledgedMessage(entry); getChannel().addUnacknowledgedMessage(entry, deliveryTag, consumer, _usesCredit); sendToClient(consumer, message, entry.getInstanceProperties(), deliveryTag); entry.incrementDeliveryCount(); } } }
@Override protected void doSendInternal(final MessageInstanceConsumer consumer, final MessageInstance entry, final AMQMessage message, final boolean batch) { // if we do not need to wait for client acknowledgements // we can decrement the reference count immediately. // By doing this _before_ the send we ensure that it // doesn't get sent if it can't be dequeued, preventing // duplicate delivery on recovery. // The send may of course still fail, in which case, as // the message is unacked, it will be lost. _txn.dequeue(entry.getEnqueueRecord(), NOOP); try( MessageReference ref = entry.getMessage().newReference()) { InstanceProperties props = entry.getInstanceProperties(); entry.delete(); getChannel().getConnection().setDeferFlush(batch); long deliveryTag = getChannel().getNextDeliveryTag(); sendToClient(consumer, message, props, deliveryTag); } }
new MessageMetaData(info, contentHeader, getConnection().getLastReadTime());