use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.
the class ProtocolOutputConverterImpl method confirmConsumerAutoClose.
@Override
public void confirmConsumerAutoClose(int channelId, AMQShortString consumerTag) {
BasicCancelOkBody basicCancelOkBody = _connection.getMethodRegistry().createBasicCancelOkBody(consumerTag);
writeFrame(basicCancelOkBody.generateFrame(channelId));
}
use of org.apache.qpid.server.protocol.v0_8.AMQShortString 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.AMQShortString 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);
}
use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.
the class BasicConsumeBody method process.
public static void process(final QpidByteBuffer buffer, final ServerChannelMethodProcessor dispatcher) throws AMQFrameDecodingException {
int ticket = buffer.getUnsignedShort();
AMQShortString queue = AMQShortString.readAMQShortString(buffer);
AMQShortString consumerTag = AMQShortString.readAMQShortString(buffer);
byte bitfield = buffer.get();
boolean noLocal = (bitfield & 0x01) == 0x01;
boolean noAck = (bitfield & 0x02) == 0x02;
boolean exclusive = (bitfield & 0x04) == 0x04;
boolean nowait = (bitfield & 0x08) == 0x08;
FieldTable arguments = EncodingUtils.readFieldTable(buffer);
if (!dispatcher.ignoreAllButCloseOk()) {
dispatcher.receiveBasicConsume(queue, consumerTag, noLocal, noAck, exclusive, nowait, arguments);
}
if (arguments != null) {
arguments.clearEncodedForm();
}
}
use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.
the class MessagePublishInfoImplTest method testRoutingKey.
/**
* Check that the routingKey value is perserved
*/
public void testRoutingKey() {
assertEquals(_routingKey, _mpi.getRoutingKey());
AMQShortString newRoutingKey = new AMQShortString("newRoutingKey");
// Check we can update the routingKey
_mpi.setRoutingKey(newRoutingKey);
assertEquals(newRoutingKey, _mpi.getRoutingKey());
// Ensure that the new routingKey doesn't equal the old one
assertFalse(_routingKey.equals(_mpi.getRoutingKey()));
}
Aggregations