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 2B360200C2A for ; Wed, 1 Mar 2017 16:07:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 29A19160B70; Wed, 1 Mar 2017 15:07:13 +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 5BEA2160B5E for ; Wed, 1 Mar 2017 16:07:12 +0100 (CET) Received: (qmail 25362 invoked by uid 500); 1 Mar 2017 15:07:11 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 25350 invoked by uid 99); 1 Mar 2017 15:07:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2017 15:07:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 982BFC456C for ; Wed, 1 Mar 2017 15:07:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 79x0UYs2yzO0 for ; Wed, 1 Mar 2017 15:07:08 +0000 (UTC) Received: from mail-qk0-f182.google.com (mail-qk0-f182.google.com [209.85.220.182]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id ABA455F2C5 for ; Wed, 1 Mar 2017 15:07:07 +0000 (UTC) Received: by mail-qk0-f182.google.com with SMTP id n186so72391282qkb.3 for ; Wed, 01 Mar 2017 07:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=QjmFfeutePrm8aKswwArl1JeMGw++wlSFyzvd5w5Eic=; b=Z1hrn9WcDv47KF0PnBenVhjOLCqa12g6U/urB1OaTsJA/x+wtePLXzwjYZPmoxMweC aTyb+NEdJ8mIZbv0Z7l4J2MkIR3KwwJrhCt2GIKDGKIyaHzeaZCZQ6TK20K0DS5MHg+v T7n0hTI2S26hhm/+FSATzoMCntwyZwewVlY7RttjZ/4055CJ+0fF7xfcmFvtckFdSunS ZTszSw6BjZRKb+7P7pgWrSpW9ifseEli7UIj1rUy2mYbzUX3WAokaRUE3LT2FwQjaXEG 6G1HChIL193iwc/69d3jwdZuBAY4X9uvpJordIfugOKYLr2wEsd1SjfdlPI0Y4hLm1ry 8w4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=QjmFfeutePrm8aKswwArl1JeMGw++wlSFyzvd5w5Eic=; b=PGiAqUzQg2JVlvXPFsrXlLZ4r0WylIjlx20SofjOPyEDLErdYm+mkiZ0seJxxD7L0w ckLzpCu36NbZJpnUZiQjrg8slwcTI6d6SuTTXoZ7spN3vJ12qD5HxornSWLKNvwLbLTN FjTDavhhGxBIpHJjVzDjFqGhpjOhEstPo+d8oOCssMwO/MaW1xA00I29oBtUtoofhIYH Nj0v4iNp6Uib5K/wrcpJiXIx2eFKD2/UJpr571pm1vTuuylfgQrCgPbfkYMu96QwnLJB 5XTQt9cO3Yiycy6MQ10vPBZjUKReRFaZ5SaAclCNWJBphlQVvgMtlRKcypteTC97g4Vp +5xA== X-Gm-Message-State: AMke39l00DtYdNhoqzSMUa5EZvkL+lb73PoQv/TIoSWdsivTM6krpLFNx85PeXhrIuoUQ0YoQc6JhX3zUZcG7A== X-Received: by 10.200.49.76 with SMTP id h12mr10343450qtb.44.1488380821198; Wed, 01 Mar 2017 07:07:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.45.100 with HTTP; Wed, 1 Mar 2017 07:07:00 -0800 (PST) In-Reply-To: <1488378679.5694.23.camel@gmail.com> References: <1488378679.5694.23.camel@gmail.com> From: Robbie Gemmell Date: Wed, 1 Mar 2017 15:07:00 +0000 Message-ID: Subject: Re: [proton-j] handling of link-credit To: "users@qpid.apache.org" Content-Type: text/plain; charset=UTF-8 archived-at: Wed, 01 Mar 2017 15:07:13 -0000 On 1 March 2017 at 14:31, Kai Hudalla wrote: > Hi, > > we are working on the Eclipse Hono project where we use vertx-proton and > (implicitly) proton-j under the hood for exchanging large amounts of messages > using AMQP 1.0. > > During our tests I stumbled across the way that proton-j seems to handle link- > credit being exchanged via FLOWs. > My understanding is the following: > > Assuming that we have a link established between a Receiver (r) and a Sender (s) > with a current link-credit of 4 and a delivery count of 20 on both sides. > > When invoking r.flow(6), the given credit (6) is _added_ to the receiver's > current credit resulting in r.getCredit() returning 10. > > When the FLOW is then flushed to the sender, the sender seems to _add_ the link- > credit from the FLOW to its already existing credit. Analogously, this results in > s.getCredit() now returning 10. Correct. In proton the flow(credits) method grants additional credits. > > With this approach, it doesn't seem to be possible to stop the sender from > sending messages. The only thing a receiver can do is to wait until the sender > has used up all its credit (which may be a lot given that with the current > approach the sender's credit can pile up substantially). > > Or am I mistaken? Granting credits is essentially giving the sender ability to send that many messages. If you are controlling credit, any 'pile up' of credit at the sender is one that you create yourself - if you dont want the sender to be able to send more than a certain number of messages at a given time, dont allow more than that number of credits to be outstanding at the time. One thing you may not be aware of is you can drain the link of existing credit, which essentially asks the sender to send what they can (something they typically will have already done if they have credit and anything to send) then spontaneously advance the delivery count to the extent needed to use up all outstanding credit. > > Also, I cannot find the code where the link credit is actually updated from a > FLOW received from a Receiver. Can you point me to the right class? > TransportSender is probably what you want. > Regards, > Kai > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > For additional commands, e-mail: users-help@qpid.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org