Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 12B492004CA for ; Wed, 11 May 2016 13:36:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1165D1602BE; Wed, 11 May 2016 11:36:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4E09C160A13 for ; Wed, 11 May 2016 13:36:14 +0200 (CEST) Received: (qmail 62402 invoked by uid 500); 11 May 2016 11:36:13 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 62313 invoked by uid 99); 11 May 2016 11:36:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2016 11:36:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1F2F32C1F6E for ; Wed, 11 May 2016 11:36:13 +0000 (UTC) Date: Wed, 11 May 2016 11:36:13 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARTEMIS-46) AMQP interop: Active broker does not respect the "drain" flag. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 11 May 2016 11:36:15 -0000 [ https://issues.apache.org/jira/browse/ARTEMIS-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15279985#comment-15279985 ] ASF GitHub Bot commented on ARTEMIS-46: --------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/activemq-artemis/pull/514 > AMQP interop: Active broker does not respect the "drain" flag. > -------------------------------------------------------------- > > Key: ARTEMIS-46 > URL: https://issues.apache.org/jira/browse/ARTEMIS-46 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: AMQP > Affects Versions: 1.0.0 > Reporter: Alan Conway > Priority: Minor > Fix For: 1.3.0 > > > The drain flag on the AMQP flow performative allows a client to request confirmation that it has received the last available message that it has credit to receive. > To reproduce using the qpid-send, qpid-receive clients from http://svn.apache.org/repos/asf/qpid/trunk/qpid/. Create a JMS queue 'foo' on the active broker then run: > $ qpid-send -a jms.queue.foo -b localhost:5455 --content-string XXX --connection-options='{protocol:amqp1.0}' > $ qpid-receive -a jms.queue.foo -b localhost:5455 --connection-options='{protocol:amqp1.0}' --log-enable trace+:Protocol > qpid-receive hangs, the last line of output is: > 2014-11-24 15:15:46 [Protocol] trace [58e8ee08-0f33-426b-b77a-450f7c3d976c]: 0 -> @flow(19) [next-incoming-id=2, incoming-window=2147483647, next-outgoing-id=0, outgoing-window=0, handle=0, delivery-count=1, link-credit=1, drain=true] > This shows that qpid-receive sent a flow with drain=true but never received a response. > Why is this important? Without the drain flag it is impossible for a client to implement the simple behavior "get the next message" correctly. The flow response tells the client immediately "there are no more messages available for you". Without it the client can only use a timeout which is unreliable (if too short the client may give up while the message is in flight) and inefficient (if too long the client will wait needlessly for messages that the broker knows are not presently available) > The spec 2.6.7 is a little ambiguous about whether this is a SHOULD or a MUST behavior but without it it is impossible to implement the use cases described in the following section. > AMQP 1.0 specification 2.7.6 > drain > The drain flag indicates how the sender SHOULD behave when insufficient messages are available to consume the current link-credit. If set, the sender will (after sending all available messages) advance the delivery-count as much as possible, consuming all link-credit, and send the flow state to the receiver. Only the receiver can independently modify this field. The sender's value is always the last known value indicated by the receiver. > If the link-credit is less than or equal to zero, i.e., the delivery-count is the same as or greater than the delivery-limit, a sender MUST NOT send more messages. If the link-credit is reduced by the receiver when transfers are in-flight, the receiver MAY either handle the excess messages normally or detach the link with a transfer-limit-exceeded error code. > Figure 2.40: Flow Control > +----------+ +----------+ > | Sender |---------------transfer------------>| Receiver | > +----------+ +----------+ > \ / <----------------flow--------------- \ / > +------+ +------+ > | > | > | > if link-credit <= 0 then pause > > If the sender's drain flag is set and there are no available messages, the sender MUST advance its delivery-count until link-credit is zero, and send its updated flow state to the receiver. -- This message was sent by Atlassian JIRA (v6.3.4#6332)