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 59C01200B6B for ; Thu, 25 Aug 2016 10:30:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 583A9160A94; Thu, 25 Aug 2016 08:30:32 +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 A09C4160A93 for ; Thu, 25 Aug 2016 10:30:31 +0200 (CEST) Received: (qmail 49915 invoked by uid 500); 25 Aug 2016 08:30:30 -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 49895 invoked by uid 99); 25 Aug 2016 08:30:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2016 08:30:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DC430180227 for ; Thu, 25 Aug 2016 08:30:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.428 X-Spam-Level: X-Spam-Status: No, score=-6.428 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-1.426, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 9xkYGAR4x0NQ for ; Thu, 25 Aug 2016 08:30:28 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7115B5F30B for ; Thu, 25 Aug 2016 08:30:27 +0000 (UTC) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 247FD80088 for ; Thu, 25 Aug 2016 08:30:26 +0000 (UTC) Received: from ovpn-112-32.phx2.redhat.com (ovpn-112-32.phx2.redhat.com [10.3.112.32]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7P8UKDG003435; Thu, 25 Aug 2016 04:30:23 -0400 Message-ID: <1472113820.22875.91.camel@redhat.com> Subject: Re: Proton C++ binding: cases where value may not be present not handled correctly where methods return std::string From: Alan Conway To: Andrew Stitcher , Kim van der Riet , Clifford Jansen Cc: users Date: Thu, 25 Aug 2016 09:30:20 +0100 In-Reply-To: <1472062838.22875.63.camel@redhat.com> References: <679ac6a8-44c7-bc09-b7e5-480549518b60@redhat.com> <1472055811.5196.27.camel@redhat.com> <1472058583.22875.45.camel@redhat.com> <1472061088.5196.28.camel@redhat.com> <1472062838.22875.63.camel@redhat.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 25 Aug 2016 08:30:26 +0000 (UTC) archived-at: Thu, 25 Aug 2016 08:30:32 -0000 Wanted to get this API conversation on the public list. The AMQP protocol treats all properties as "optional" so on the wire properties can be "missing". Other APIs can represent this distinction, e.g. python returns None for missing and "" for empty string. The C++ API repreents properties like reply-to as a std::string, which has no way of representing "missing". C++ returns the same empty string value for missing reply-to and reply-to="" Kim's interop testing verifies whether we correctly propagate the missing/empty distinction so he can't port (some of) his tests to C++. Does this matter?  astitcher argues that there is no semantic difference between missing and "" for values like reply-to and we shouldn't complicate the API. I see where he's coming from, but I still argue that ... On Wed, 2016-08-24 at 19:20 +0100, Alan Conway wrote: > On Wed, 2016-08-24 at 13:51 -0400, Andrew Stitcher wrote: > > > > On Wed, 2016-08-24 at 18:09 +0100, Alan Conway wrote: > > > > > > > > > ... > > > There is a semantic difference in the AMQP specification.  > > > > Well, what is the difference (semantically)? > >   > > A message with no correlation-id is not the same as a message with a > correlation-id of the empty string or the integer 0. 0 might be a > real > correlation ID in an integer sequence. "" would be a silly > correlation- > id but we don't choose them so we can't assume it won't ever be used. > > A message with no reply-to address is not (on the wire) the same as a > message with reply-to="". It would be daft to design a system where > "" > is a legal address, but we don't control what the remote endpoint > does. > It is conceivable that somewhere, reply-to="" means reply to the node > called "" not don't reply. > > C++ does not have much of a notion of "missing" but python does with > None. It's conceivable in an all-python system that someone makes an > ill-advised assumpiton that `"" != None` in an AMQP property. I'm not > saying it is a good idea to do that, just that C++ needs to be able > to > talk to anything that speaks AMQP, even if it does things that are > not > a great idea. > > Another case to consider is a mid-tier server that forwards messages. > It might be bad if it "fills in" default values as a side effect. > Even > if there's no semantic problem it makes messages bigger and otherwise > is just doing things the user didn't ask for. > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org