Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A53C511F0B for ; Fri, 29 Aug 2014 14:42:54 +0000 (UTC) Received: (qmail 52494 invoked by uid 500); 29 Aug 2014 14:42:54 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 52459 invoked by uid 500); 29 Aug 2014 14:42:54 -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 52445 invoked by uid 99); 29 Aug 2014 14:42:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Aug 2014 14:42:54 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rob.j.godfrey@gmail.com designates 209.85.216.172 as permitted sender) Received: from [209.85.216.172] (HELO mail-qc0-f172.google.com) (209.85.216.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Aug 2014 14:42:48 +0000 Received: by mail-qc0-f172.google.com with SMTP id o8so2512819qcw.3 for ; Fri, 29 Aug 2014 07:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UZWeqlifC+aWUHM48JBQZDupDgWBn3Dqh5aQzv8CsW0=; b=hYSDmIm2EEwL3AuydO1BVdVBiMvNHd2g5ihra6cSr/eR+fBX4731iJFmUfWqNnuw6x oRGogVSbb8cIXfxt0DnuKPPR/4cWxiexnwr+MNV75zetDYbcCaLWi/LQYr1iMmfkP8WA 79WGi6wpl6Dakctv68A37OcEe7gsjo6dlo/TEridd/pMB4XdFHPZy8DsDtjQ0K6eJFJT hqvfKFmgQrAjGUXQZFlhqFfcpHScLdbCLxqV00z7Qyjz5PymdPfhLFt7KfhGughS7sfF bA95p81hTKJpi4BptL2DPqrqS/Y8qq8iGX5uZEzw54czeNQ7hP2kKBA7hrwbyA8RRr5g Qq6A== MIME-Version: 1.0 X-Received: by 10.140.41.101 with SMTP id y92mr16944639qgy.69.1409323347873; Fri, 29 Aug 2014 07:42:27 -0700 (PDT) Received: by 10.140.101.6 with HTTP; Fri, 29 Aug 2014 07:42:27 -0700 (PDT) In-Reply-To: <54008D1D.3000609@redhat.com> References: <5400865A.4040309@blueyonder.co.uk> <54008D1D.3000609@redhat.com> Date: Fri, 29 Aug 2014 16:42:27 +0200 Message-ID: Subject: Re: Use of subject for routing - moved thread to user list from earlier private discussion. From: Rob Godfrey To: "users@qpid.apache.org" Content-Type: multipart/alternative; boundary=001a11c120148645900501c5a962 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c120148645900501c5a962 Content-Type: text/plain; charset=UTF-8 On 29 August 2014 16:24, Gordon Sim wrote: > On 08/29/2014 03:12 PM, Rob Godfrey wrote: > >> In general, however, I think the subject is not the best fit for a mapping >> of the semantics of the 0.x "routing-key". The AMQP 1.0 spec defines >> subject as "A common field for summary information about the message >> content and purpose", rather than giving it and explicit or implicit >> routing semantics. >> > > In my view, the 'routing key' in the old exchanges model is intended to be > exactly such a logical categorisation of the messages content or purpose. > > > But the definition is "summary"... such as "Use of subject for routing - moved thread to user list from earlier private discussion." is a summary for this thread. It does not in any way imply structured. > The "to" field is defined as "identifies the node that >> is the intended destination of the message" which definitely implies some >> routing semantics but does not make them explicit. >> > > As you state, the to field identifies the destination. That is not what > the old exchange types are about in my view. In the typical use cases for > that old model, the sender doesn't want to describe who gets the queue, > they merely want to indicate the type or purpose of the messages. It is > then through the bindings that this type is mapped to the appropriate > recipient(s). The to field indicates the destination in terms of what the sender wants to send it to. It says nothing about where it actually arrives. How an address is translated to an ultimate recipient of the message is a property of the network, that the sender can be unaware of. Note that I think here that the Messenger use of explicit hostnames/ports in "addresses" is confusing. This might be a particular use case for addresses, but I think in general the tying of addresses to physical locations is a very bad thing. Addresses are logical. I think the issue here is how many fields you expect the sender of a message to have to populate to route a message. In 0.x the model generally implied two fields "exchange" and "routing-key" that taken together would allow the intermediary to route the message. My take on the mapping to AMQP 1.0 is that one should consider this as a compound address "exchange/routing-key". As such the AMQP 1.0 address is actually more opaque and allows more indirection than the 0.x form where the sender of the message was made aware of a distinction between exchange and routing-key (and in fact the method of routing was de facto also being made explicit). > > > If an application is designed around using AMQP 1.0, I would not normally >> expect them to be putting routing information in the subject field. >> > > That depends on what you define to be routing information. I think it is a > perfectly sensible approach to use the subject to indicate some sort of > logical category and then have the broker be configured to 'route' messages > according to that logical category. > I think that's one choice you could make, certainly. I just think it's a bad choice for the general case. I think using a single field to provide the information you wish the message to be routed on is, in general, superior. In practice if one wants to add supplemental fields for routing I think it would be better to use application properties. By using an application property it is easier for messages coming from other APIs (such as JMS) or messages being translated from other protocols (where the notion of application structured data is common) to also use the same routing semantics. -- Rob > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > For additional commands, e-mail: users-help@qpid.apache.org > > --001a11c120148645900501c5a962--