use of org.apache.qpid.server.protocol.v0_8.transport.AMQBody in project qpid-broker-j by apache.
the class Interaction method sendPerformative.
public Interaction sendPerformative(int channel, final AMQBody amqBody) throws Exception {
final AMQFrame frameBody = new AMQFrame(channel, amqBody);
sendPerformativeAndChainFuture(frameBody);
return this;
}
use of org.apache.qpid.server.protocol.v0_8.transport.AMQBody in project qpid-broker-j by apache.
the class ProtocolOutputConverterImpl method writeReturn.
@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);
}
use of org.apache.qpid.server.protocol.v0_8.transport.AMQBody in project qpid-broker-j by apache.
the class ProtocolOutputConverterImpl method writeDeliver.
@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);
}
use of org.apache.qpid.server.protocol.v0_8.transport.AMQBody in project qpid-broker-j by apache.
the class ProtocolOutputConverterImpl method writeMessageDeliveryUnchanged.
private void writeMessageDeliveryUnchanged(MessageContentSource content, int channelId, AMQBody deliverBody, ContentHeaderBody contentHeaderBody, int bodySize) {
if (bodySize == 0) {
SmallCompositeAMQBodyBlock compositeBlock = new SmallCompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody);
writeFrame(compositeBlock);
} else {
int maxBodySize = (int) _connection.getMaxFrameSize() - AMQFrame.getFrameOverhead();
int capacity = bodySize > maxBodySize ? maxBodySize : bodySize;
int writtenSize = capacity;
AMQBody firstContentBody = new MessageContentSourceBody(content, 0, capacity);
CompositeAMQBodyBlock compositeBlock = new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody, firstContentBody);
writeFrame(compositeBlock);
while (writtenSize < bodySize) {
capacity = bodySize - writtenSize > maxBodySize ? maxBodySize : bodySize - writtenSize;
AMQBody body = new MessageContentSourceBody(content, writtenSize, capacity);
writtenSize += capacity;
writeFrame(new AMQFrame(channelId, body));
}
}
}
use of org.apache.qpid.server.protocol.v0_8.transport.AMQBody in project qpid-broker-j by apache.
the class ProtocolOutputConverterImpl method createEncodedGetOkBody.
private AMQBody createEncodedGetOkBody(AMQMessage message, InstanceProperties props, long deliveryTag, int queueSize) {
final AMQShortString exchangeName;
final AMQShortString routingKey;
final MessagePublishInfo pb = message.getMessagePublishInfo();
exchangeName = pb.getExchange();
routingKey = pb.getRoutingKey();
final boolean isRedelivered = Boolean.TRUE.equals(props.getProperty(InstanceProperties.Property.REDELIVERED));
return _connection.getMethodRegistry().createBasicGetOkBody(deliveryTag, isRedelivered, exchangeName, routingKey, queueSize);
}
Aggregations