@Override public long writeDeliver(final AMQMessage msg, final InstanceProperties props, int channelId, long deliveryTag, AMQShortString consumerTag) { final boolean isRedelivered = Boolean.TRUE.equals(props.getProperty(InstanceProperties.Property.REDELIVERED)); AMQBody deliverBody = createEncodedDeliverBody(msg, isRedelivered, deliveryTag, consumerTag); return writeMessageDelivery(msg, channelId, deliverBody); }
@Override public long writeGetOk(final AMQMessage amqMessage, final InstanceProperties props, int channelId, long deliveryTag, int queueSize) { AMQBody deliver = createEncodedGetOkBody(amqMessage, props, deliveryTag, queueSize); return writeMessageDelivery(amqMessage, channelId, deliver); }
@Override public void writeReturn(MessagePublishInfo messagePublishInfo, ContentHeaderBody header, MessageContentSource message, int channelId, int replyCode, AMQShortString replyText) { AMQBody returnFrame = createEncodedReturnFrame(messagePublishInfo, replyCode, replyText); writeMessageDelivery(message, header, channelId, returnFrame); }
boolean msgCompressed = isCompressed(contentHeaderBody); DisposableMessageContentSource modifiedContent = null; if(msgCompressed && !compressionSupported && (modifiedContent = inflateIfPossible(message)) != null) modifiedProps.setEncoding((String)null); length = writeMessageDeliveryModified(modifiedContent, channelId, deliverBody, modifiedProps); && contentHeaderBody.getProperties().getEncoding()==null && bodySize > _connection.getMessageCompressionThreshold() && (modifiedContent = deflateIfPossible(message)) != null) modifiedProps.setEncoding(GZIP_ENCODING); length = writeMessageDeliveryModified(modifiedContent, channelId, deliverBody, modifiedProps); writeMessageDeliveryUnchanged(message, channelId, deliverBody, contentHeaderBody, bodySize);
@Override public void confirmConsumerAutoClose(int channelId, AMQShortString consumerTag) { BasicCancelOkBody basicCancelOkBody = _connection.getMethodRegistry().createBasicCancelOkBody(consumerTag); writeFrame(basicCancelOkBody.generateFrame(channelId)); }
private void setProtocolVersion(ProtocolVersion pv) { // TODO MultiVersionProtocolEngine takes responsibility for making the ProtocolVersion determination. // These steps could be moved to construction. _protocolVersion = pv; _methodRegistry = new MethodRegistry(_protocolVersion); _protocolOutputConverter = new ProtocolOutputConverterImpl(this); }
private long writeMessageDelivery(AMQMessage message, int channelId, AMQBody deliverBody) { return writeMessageDelivery(message, message.getContentHeaderBody(), channelId, deliverBody); }
contentHeaderBody); writeFrame(compositeBlock); try (QpidByteBuffer chunk = contentByteBuffer.view(0, contentChunkSize)) writeFrame(new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody, writeFrame(new AMQFrame(channelId, new MessageContentSourceBody(chunk)));