Example #1
0
        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());
        }
Example #2
0
        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);
        }