public void OnDelivery(AmqpLink link, Delivery delivery) { var message = AnnotatedMessage.Decode(delivery.PayloadBuffer); var queue = linkNameToQueue[link.Name]; queue.Enqueue(message); link.SetDeliveryTerminalState(delivery, new Accepted()); }
protected override void OnMessageAquired(QueueEntry next) { var message = (AnnotatedMessage)next.Item; var payloadBuffer = new ByteBuffer(AnnotatedMessage.GetEstimatedMessageSize(message), false); AnnotatedMessage.Encode(message, payloadBuffer); var deliveryTag = Guid.NewGuid().ToByteArray(); link.SendTransfer(deliveryTag, payloadBuffer); }