private void sendFlow(boolean flow) { MethodRegistry methodRegistry = _connection.getMethodRegistry(); AMQMethodBody responseBody = methodRegistry.createChannelFlowBody(flow); _connection.writeFrame(responseBody.generateFrame(_channelId)); }
@Override public void receiveBasicQos(final long prefetchSize, final int prefetchCount, final boolean global) { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] BasicQos[" +" prefetchSize: " + prefetchSize + " prefetchCount: " + prefetchCount + " global: " + global + " ]"); } sync(); setCredit(prefetchSize, prefetchCount); MethodRegistry methodRegistry = _connection.getMethodRegistry(); AMQMethodBody responseBody = methodRegistry.createBasicQosOkBody(); _connection.writeFrame(responseBody.generateFrame(getChannelId())); }
@Override public void receiveChannelFlow(final boolean active) { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] ChannelFlow[" +" active: " + active + " ]"); } sync(); if(_channelFlow != active) { _channelFlow = active; // inform consumer targets updateAllConsumerNotifyWorkDesired(); } setSuspended(!active); MethodRegistry methodRegistry = _connection.getMethodRegistry(); AMQMethodBody responseBody = methodRegistry.createChannelFlowOkBody(active); _connection.writeFrame(responseBody.generateFrame(getChannelId())); }
@Override public void receiveTxRollback() { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] TxRollback"); } if (!isTransactional()) { closeChannel(ErrorCodes.COMMAND_INVALID, "Fatal error: rollback called on non-transactional channel"); } else { final MethodRegistry methodRegistry = _connection.getMethodRegistry(); final AMQMethodBody responseBody = methodRegistry.createTxRollbackOkBody(); Runnable task = () -> _connection.writeFrame(responseBody.generateFrame(_channelId)); rollback(task); // TODO: This is not spec compliant but we currently seem to rely on this behaviour resend(); } }
@Override public void receiveBasicRecover(final boolean requeue, final boolean sync) { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] BasicRecover[" + " requeue: " + requeue + " sync: " + sync + " ]"); } if (requeue) { requeue(); } else { resend(); } if (sync) { MethodRegistry methodRegistry = _connection.getMethodRegistry(); AMQMethodBody recoverOk = methodRegistry.createBasicRecoverSyncOkBody(); sync(); _connection.writeFrame(recoverOk.generateFrame(getChannelId())); } }
mechanisms.getBytes(US_ASCII), locales.getBytes(US_ASCII)); writeFrame(responseBody.generateFrame(0)); _state = ConnectionState.AWAIT_START_OK;
_connection.writeFrame(responseBody.generateFrame(_channelId));
_connection.writeFrame(declareOkBody.generateFrame(getChannelId())); _connection.writeFrame(declareOkBody.generateFrame(getChannelId())); _connection.writeFrame(declareOkBody.generateFrame(getChannelId())); _connection.writeFrame(declareOkBody.generateFrame(getChannelId())); _connection.writeFrame(declareOkBody.generateFrame(getChannelId()));
public AMQChannel(AMQPConnection_0_8 connection, int channelId, final MessageStore messageStore) { super(connection, channelId); _creditManager = new Pre0_10CreditManager(0L, 0L, connection.getContextValue(Long.class, AMQPConnection_0_8.HIGH_PREFETCH_LIMIT), connection.getContextValue(Long.class, AMQPConnection_0_8.BATCH_LIMIT)); _unacknowledgedMessageMap = new UnacknowledgedMessageMapImpl(DEFAULT_PREFETCH, this); _connection = connection; _channelId = channelId; _messageStore = messageStore; _blockingTimeout = connection.getBroker().getContextValue(Long.class, Broker.CHANNEL_FLOW_CONTROL_ENFORCEMENT_TIMEOUT); // by default the session is non-transactional _transaction = new AsyncAutoCommitTransaction(_messageStore, this); MethodRegistry methodRegistry = _connection.getMethodRegistry(); AMQMethodBody responseBody = methodRegistry.createTxCommitOkBody(); _txCommitOkFrame = new CachedFrame(responseBody.generateFrame(_channelId)); _clientDeliveryMethod = connection.createDeliveryMethod(_channelId); AccessController.doPrivileged((new PrivilegedAction<Object>() { @Override public Object run() { message(ChannelMessages.CREATE()); return null; } }),_accessControllerContext); }
AMQMethodBody responseBody = methodRegistry.createConnectionOpenOkBody(virtualHostName); writeFrame(responseBody.generateFrame(0)); _state = ConnectionState.OPEN;
MethodRegistry methodRegistry = _connection.getMethodRegistry(); AMQMethodBody responseBody = methodRegistry.createQueuePurgeOkBody(purged); _connection.writeFrame(responseBody.generateFrame(getChannelId()));
MethodRegistry methodRegistry = _connection.getMethodRegistry(); AMQMethodBody responseBody = methodRegistry.createQueueBindOkBody(); _connection.writeFrame(responseBody.generateFrame(getChannelId()));
_connection.writeFrame(responseBody.generateFrame(getChannelId()));