use of com.microsoft.azure.sdk.iot.deps.transport.amqp.AmqpsMessage in project azure-iot-sdk-java by Azure.
the class ReceiverLinkHandler method getMessageFromReceiverLink.
protected AmqpsMessage getMessageFromReceiverLink() {
Delivery delivery = receiverLink.current();
if (delivery.isReadable() && !delivery.isPartial()) {
int size = delivery.pending();
byte[] buffer = new byte[size];
int read = receiverLink.recv(buffer, 0, buffer.length);
receiverLink.advance();
AmqpsMessage message = new AmqpsMessage();
message.decode(buffer, 0, read);
message.setDelivery(delivery);
return message;
}
return null;
}
Aggregations