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 5190B200C2B for ; Thu, 2 Mar 2017 16:06:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 500FB160B6F; Thu, 2 Mar 2017 15:06:57 +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 74F30160B61 for ; Thu, 2 Mar 2017 16:06:56 +0100 (CET) Received: (qmail 60698 invoked by uid 500); 2 Mar 2017 15:06:55 -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 60679 invoked by uid 99); 2 Mar 2017 15:06:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2017 15:06:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E86D21A7BAE for ; Thu, 2 Mar 2017 15:06:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.88 X-Spam-Level: * X-Spam-Status: No, score=1.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id r_9lKHr4jgpu for ; Thu, 2 Mar 2017 15:06:52 +0000 (UTC) Received: from mail-yw0-f177.google.com (mail-yw0-f177.google.com [209.85.161.177]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A2EFC5FB62 for ; Thu, 2 Mar 2017 15:06:51 +0000 (UTC) Received: by mail-yw0-f177.google.com with SMTP id v200so58630539ywc.3 for ; Thu, 02 Mar 2017 07:06:51 -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=WnHxmeFAi0emHEWckEkAbKq5naopVTRKL3pG1onQpJM=; b=KoB8hJnaCUj1Fnd4aXJNNF4wQMOQnyP8s7dXixW+RJg24Hv+pOVQZud/B2mXidniwC nkmA8aMzLgCfGqul6ef5AUXTtj9wdGpueeCpCCYXemZ7oye/Hj3fGFybK+QD1RZUjvX/ 76591Ddq2mr78VKso6S577WhY78J8/1UTu8Bt1lOjIN4wdsRE4r7KDO1rstGukctA/yB TzlV3KKmXIC/g64B1sPVGBRxTaPPQREfzxAl0Jjdn9Iiy3Gh49cJ4w8LzsQp3tnvWnzc TzYunmU2ZOLkZyQHGqQgm+YbRcFY3vu4xkr7KSaYXso9YHX8G32p5YYTUf50zxfSaIdD /xwA== 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=WnHxmeFAi0emHEWckEkAbKq5naopVTRKL3pG1onQpJM=; b=VMbZqWhuD9fsAJEsY/KDy/tWPqRTZIWoa1gELkptznll+qP1RzJMpMaKHUerhdJPuf 5J1w+tX/RqQapEI9aCL4fL5R4wsDojzeRrpPv4sUz48VWEEfIUdgDnNYmSNSloHwyucj QuAtnlP3aRjMLJ7muoDsR8qti06qXINs4NxPxfCijffB5J9PqjlwZPVaNS2eltnZLdCU XSGWfJsMo09VLVsRgPxJtVngmjYvNCe2v0acZVY/P7ruh+xUhNyfEp7Lg9tBdb1GsIni o6qSBoTlnUmuz0zetwN3/kB5XwFVKDP0FzSAEEcw+6NJ+wz39fsF70Hp1VOtPWmFYtzV GtRQ== X-Gm-Message-State: AMke39nM4GvU+fyvMkAwsgLo8EtUgG+Ikqn+gNdY3uXdvNIAoi4L3a7WevphrY2GLhTaIH1EjE0ushjL2Up3+A== X-Received: by 10.200.36.194 with SMTP id t2mr18240188qtt.61.1488467209272; Thu, 02 Mar 2017 07:06:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.137.59 with HTTP; Thu, 2 Mar 2017 07:06:48 -0800 (PST) In-Reply-To: References: From: Rob Godfrey Date: Thu, 2 Mar 2017 16:06:48 +0100 Message-ID: Subject: Re: Accessing queues with '/' in name in Rest API [qpid java broker 6.0.4] To: "users@qpid.apache.org" Content-Type: multipart/alternative; boundary=001a113c00c644c5de0549c0c780 archived-at: Thu, 02 Mar 2017 15:06:57 -0000 --001a113c00c644c5de0549c0c780 Content-Type: text/plain; charset=UTF-8 On 2 March 2017 at 15:11, Antoine Chevin wrote: > Thank you Rob for the very detailed answer. > I saw in the code > (org.apache.qpid.server.protocol.v1_0.Session_1_0#remoteLinkCreation)that > the exchange lookup is skipped if the address starts with a '/'. > I intend to use a '/' in the beginning because I don't want the exchange > lookup. > Do you think it is a good approach? > > So the intent here is that addresses that start with "/" are considered to be "global" addresses as previously described, addresses that start with "/" but match one of the gloabAddressDomains for the virtual host would route within the virtual host to the appropriate destination, names that begin with "/" but don't match one of the domains for the vhost would be sent via federation to a remote broker (when that code gets completed - obviously we don't have federation of that kind in the Java Broker currently). So having a name which begins with "/" may work right now, but it's reasonably likely it might break in the future. In general I would avoid "/" as well as "?", ";", ",", "[", "]", "|", "(", and ")" in queue names. Is the plan that all your queues will start with the same //... prefix, or will different queues have different prefixes? -- Rob > Thank you, > Regards, > Antoine > > -----Original Message----- > From: Rob Godfrey [mailto:rob.j.godfrey@gmail.com] > Sent: jeudi 2 mars 2017 11:09 > To: users@qpid.apache.org > Subject: Re: Accessing queues with '/' in name in Rest API [qpid java > broker 6.0.4] > > On 2 March 2017 at 10:46, Antoine Chevin wrote: > > > Thank you Rob for the answer. Yes it really helps! > > I noticed that addresses in the form / are > > also used with AMQP 1-0. Is it expected? > > > > > It is part of how the Java Broker maps the AMQP 0-x Exchange/Binding/Queue > model into the AMQP 1.0 address space, yes. > > In short when the Java Broker receives a message to an address X it first > looks to see if there is an exchange X, then if there is a queue X, then if > X contains a / it looks to see if the part before the / is an exchange > name, and if so it sends to that exchange with the part after the / being > used as the routing key. > > When the Java Broker receives a request to consume from an address X it > first looks to see if there is a Queue X, then if there is an Exchange X > (in which case it creates a temporary queue and binds with an empty binding > key), and then if X contains a / and the part before the X is an exchange > name it will create a temporary queue and bind that to the exchange with > the binding key being the part of X after the /. > > Note the asymmetry on send and consume that on send it first looks for an > exchange and on consume it first looks for a queue. > > (There are a few more rules for the globalAddressDomains and for system > addresses like $management, but the above is the general rule). > > -- Rob > > > > Thank you, > > Regards, > > Antoine > > > > On 1 March 2017 at 20:25, Olivier Mallassi > > > > wrote: > > > > > Rob, all > > > > > > Thank you rob for this. Could you please share more details > > > regarding not using the "/"? > > > > > > > > So there are a couple of reasons why I think not using a / makes sense: > > > > 1) Because of exactly the REST / encoding issue that you ran into - > > using characters that often need escaping can cause a lot of issues in > > config files, parameters etc... depending upon where the queue name > > might be used you may end up encoding that / one, two or even more > > times... this gets messy fast > > > > 2) Because in AMQP addressing we've been imaging the / as a separator > > when using some sort of topological address scheme for addressing in > > federated networks... for instance you might have a queue for orders > > in you dongle department of your widget division of your company > > foo.com... and you might expose that address as > > //foo.com/widget/dongle/orders whereas someone connected directly to > the > broker would just see the queue as "orders" > > (though they could also address it by its full "global" name). The > > Java Broker already makes some allowance for this with the notion of > > "globalAddressDomains" which you can set on the virtual host. For any > > domain in the list of defined globalAddressDomains, the > > virtualhost will accept messages sent /M as if it were sent to M > > (and the same with consuming). > > > > Also note that for the Java Broker an address of the form > name>/ can be used to send / receive via AMQP 0-x > > exchange/routing-key semantics. > > > > Hope this helps, > > Rob > > > > > > > On our side we are using amqp 1.0 that, AFAIU, promotes the "complex" > > > addressing plans > > > The benefit for us would be > > > - alignements between our http and amqp naming conventions. It is a > > > nice to have but can help lisibility > > > - use "URL" to route messages. Like the samples with the > > > linkroutepattern > > > > > > Not sure these are good ideas btw. Any feedback is welcomed > > > > > > Regards > > > > > > On Wed, 1 Mar 2017 at 18:16, Rob Godfrey > > wrote: > > > > > > > In general I'd advise against using the '/' character in queue > > > > names if possible... however if you must, then you need double > > > > encode the name, so "a/b" would become "a%252Fb" > > > > > > > > Hope this helps, > > > > Rob > > > > > > > > On 1 March 2017 at 17:31, Antoine Chevin > > > > > > > wrote: > > > > > > > > > Hello, > > > > > > > > > > I created a queue with a '/' in the name. How can I access it in > > > > > the > > > rest > > > > > api? > > > > > I tried to encode the '/' with %2F but I still get a 422 "too > > > > > many > > > > entries > > > > > in path for REST servlet queue." > > > > > Can you please help? > > > > > > > > > > Regards, > > > > > Antoine > > > > > > > > > > > > > > > --001a113c00c644c5de0549c0c780--