tabish121 commented on a change in pull request #2986: ARTEMIS-1975 Real Large
Message support into AMQP
URL: https://github.com/apache/activemq-artemis/pull/2986#discussion_r382104032
##########
File path:
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java
##########
@@ -278,39 +283,66 @@ public void onMessage(Delivery delivery) throws
ActiveMQAMQPException {
return;
}
- if (delivery.isAborted()) {
- // Aborting implicitly remotely settles, so advance
- // receiver to the next delivery and settle locally.
- receiver.advance();
- delivery.settle();
+ try {
+ if (delivery.isAborted()) {
+ // Aborting implicitly remotely settles, so advance
+ // receiver to the next delivery and settle locally.
+ receiver.advance();
+ delivery.settle();
+
+ // Replenish the credit if not doing a drain
+ if (!receiver.getDrain()) {
+ receiver.flow(1);
+ }
+
+ return;
+ } else if (delivery.isPartial()) {
Review comment:
I think you need to add some more metrics here on what constitutes a "large"
message as there isn't anything that requires a client to strictly adhere to
max frame size limits other that it shouldn't go over, it can certainly send
under that amount. A client could split a 4k message into 4 1k chunks etc so
assuming that a message is large just based on partial will lead to likely
considering messages that don't meet the normal Artemis definition of a large
message as being large. Also even if not partial you ought to be checking if
what you have in a complete message that meets your definition of a large
message as the AMQP max frame size is configurable on the protocol adapter so
you might need a second metric there to say it's not partial but it exceeds
what we consider "not large" and would prefer to store it in the large message
way.
----------------------------------------------------------------
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]
With regards,
Apache Git Services