You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2019/08/28 13:57:56 UTC

[GitHub] [activemq-nms-amqp] cjwmorgan-sol commented on a change in pull request #20: AMQNET-602: Set batchable flag to false for amqp transfer

cjwmorgan-sol commented on a change in pull request #20: AMQNET-602: Set batchable flag to false for amqp transfer
URL: https://github.com/apache/activemq-nms-amqp/pull/20#discussion_r318596031
 
 

 ##########
 File path: src/NMS.AMQP/Provider/Amqp/AmqpHandler.cs
 ##########
 @@ -0,0 +1,44 @@
+using Amqp.Framing;
+using Amqp.Handler;
+
+namespace Apache.NMS.AMQP.Provider.Amqp
+{
+    internal class AmqpHandler : IHandler
+    {
+        private readonly AmqpConnection connection;
+
+        public AmqpHandler(AmqpConnection connection)
+        {
+            this.connection = connection;
+        }
+
+        public bool CanHandle(EventId id)
+        {
+            switch (id)
+            {
+                case EventId.SendDelivery:
+                case EventId.ConnectionRemoteOpen:
+                case EventId.ConnectionLocalOpen:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+
+        public void Handle(Event protocolEvent)
+        {
+            switch (protocolEvent.Id)
+            {
+                case EventId.SendDelivery when protocolEvent.Context is IDelivery delivery:
+                    delivery.Batchable = false;
 
 Review comment:
   The client is still sending transfer frames as settled on amqp links that have sender settle mode unsettled.
   
   ```suggestion
                       delivery.Batchable = false;
                       delivery.Settle=false;
   ```
   Although is might be better to use the delivery.UserToken to hold a "SendContext" for the delivery that would assign the delivery fields per send. This SendContext could be single instance per configuration.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services