[ 
https://issues.apache.org/jira/browse/AMQNET-602?focusedWorklogId=303196&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303196
 ]

ASF GitHub Bot logged work on AMQNET-602:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Aug/19 19:47
            Start Date: 28/Aug/19 19:47
    Worklog Time Spent: 10m 
      Work Description: Havret commented on pull request #20: AMQNET-602: Set 
batchable flag to false for amqp transfer
URL: https://github.com/apache/activemq-nms-amqp/pull/20#discussion_r318761260
 
 

 ##########
 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:
   Are you sure this is that simple?
   
   I see 3 options to address this issue:
   1. Do what you suggested above.
   2. Change hard-coded settled mode for sender link to Mixed.
   3. Implement presettle policy in the same way as it is implemented in qpid 
jms. 
   
   But either way I would address this in a separate PR. I've create an issue 
https://issues.apache.org/jira/browse/AMQNET-608 and I've sent email to with 
proposed solutions to active mq mailing list to pick up community's brains 
regarding to this one. 
   
   @michaelandrepearce What do you think? 
 
----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 303196)
    Time Spent: 1h 20m  (was: 1h 10m)

> Performance issue with brokers that respect batchable flag
> ----------------------------------------------------------
>
>                 Key: AMQNET-602
>                 URL: https://issues.apache.org/jira/browse/AMQNET-602
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: AMQP, NMS
>    Affects Versions: 1.8.0
>            Reporter: Krzysztof Porebski
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> MessageProducer rate are 1 msg/sec on brokers that respect the batchable flag 
> for amqp transfers. This has been a long standing issue with amqpnetlite 
> until it was fixed for synchronous sends, version 2.1.8. The provider 
> AmqpProducer uses async sends with ManualResetEvent to block. This is bad in 
> term of amqp protocol as the transfer sent as batchable indicating to the 
> broker that disposition should not be sent right away so it waits however the 
> client is also waiting for a response leading to terrible message rates. 
> Amqpnetlite fixed this issue at least for synchronous sends from a sender 
> link where the batchable flag is set to false when a send is synchronous 
> however that means that AmqpProducer must use a different send (see 
> senderLink.send(msg) and senderLink.send(msg, timeout)) method then its 
> currently using.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to