Return-Path: Delivered-To: apmail-tuscany-dev-archive@www.apache.org Received: (qmail 2974 invoked from network); 3 Aug 2009 11:58:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Aug 2009 11:58:51 -0000 Received: (qmail 81610 invoked by uid 500); 3 Aug 2009 11:58:55 -0000 Delivered-To: apmail-tuscany-dev-archive@tuscany.apache.org Received: (qmail 81524 invoked by uid 500); 3 Aug 2009 11:58:55 -0000 Mailing-List: contact dev-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tuscany.apache.org Delivered-To: mailing list dev@tuscany.apache.org Received: (qmail 81516 invoked by uid 99); 3 Aug 2009 11:58:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 11:58:55 +0000 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [212.227.17.9] (HELO moutng.kundenserver.de) (212.227.17.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 11:58:45 +0000 Received: from [192.168.0.17] (93-97-220-25.zone5.bethere.co.uk [93.97.220.25]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MKt72-1MXwBK3uoj-000pGH; Mon, 03 Aug 2009 13:58:23 +0200 Message-ID: <4A76D0DE.9020208@apache.org> Date: Mon, 03 Aug 2009 12:58:22 +0100 From: Simon Nash User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: dev@tuscany.apache.org Subject: Re: [1.5.1] Domain manager and binding.sca References: <4A756138.2030500@apache.org> <4A760730.7030305@apache.org> <4A76B3EA.3060505@apache.org> In-Reply-To: <4A76B3EA.3060505@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19fgqqvwXoPcET9Qm96r1n0s0lMbSAP2CrChIZ wN8H2WZK9KJQeirlwmVcWLaKkpi/3TWRZ9NeeOOpmeDfgyouMf +sXd4KUnnxqxDCrx1M7Pw== X-Virus-Checked: Checked by ClamAV on apache.org Simon Nash wrote: > Simon Laws wrote: >> Hi Simon >> >>>> When creating a domain configuration from scratch using the >>>> Domain Manager GUI, the generated configuration files don't include >>>> a entry. This means that deployed composites that >>>> use binding.sca for inter-node communication don't work "out of the >>>> box" in a distributed domain configuration. In order to get this >>>> to work, it's necessary to manually edit the generated domain >>>> configuration to add elements to the node definitions. >>>> >> snip... >> >> Can you give a specific example here. I don't quite understand what >> you mean. I just ran up the store tutorial where for an input of... >> >> >> >> USD >> >> >> >> > target="StoreCurrencyConverter"/> >> >> >> >> >> >> >> I get an output from the domain manager of... >> >> >> >> >> >> > uri="http://localhost:8100/StoreCatalog"/> >> >> >> >> >> > name="currencyConverter#StoreCurrencyConverter/CurrencyConverter" >> uri="/StoreCurrencyConverter"/> >> >> >> > type="ns2:string">USD >> >> >> >> >> >> >> >> >> >> >> >> Are you talking about forward calls or callbacks or both? >> >> Regards >> >> Simon >> >> > Sorry that my previous note was not clear. I was referring to the files > in the "cloud" directory that are generated by the Domain Manager GUI > when using the Domain Manager GUI with no predefined configuration. > These currently have host/port entries for binding.ws, binding.http, > binding.jsonrpc, and binding.atom. They don't include a host/port entry > for binding.sca. > > Without this entry, application composites will always have local-only > entries (as your example shows) which means they can't > use binding.sca to communicate between different nodes. This applies > to both forward calls and callbacks. > > The good news is that my builder fix to optimize intra-node binding.sca > calls (option 3 from my earlier post) is now working for forward calls. > I now need to enable callback support, which shouldn't take long. > After that I'll run a full build to make sure that my changes haven't > disturbed anything. > > It looks like my fix is working OK. It solves the "catch 22" of the binding URIs being created before the wiring is done. This ordering means that it isn't possible to use the presence or absence of wires to influence whether a relative or absolute URI is created for binding.sca. The desired behaviour for is to create an absolute URI for reference and service bindings (including reference callback bindings) if the reference and service are wired across composites running on different nodes in a distributed configuration. For references and services that aren't wired, or that are wired within a composite running on a single node in a distributed configuration, the binding URI should be relative so that locally optimized calling is used. With my fix, the URI creation step still happens first. If the binding type is binding.sca and the builders are being called by the domain manager to create a node configuration, a "tentative" relative URI is created for the binding and the binding is added to a Map that maintains binding/node relationships (the bindingMap). When the domain wiring is done later, there is code in the matchBinding() method of BindingConfigurationUtil that uses the bindingMap created in the first step to look up which node the reference or service is running on. If the source and target of the wire are running on different nodes, the "tentative" relative URI is updated to convert it to an absolute URI with host/port information. In all other cases the "tentative" relative URI is left unchanged. For reference callback URIs, the "tentative" relative URI is updated to an absolute URI if and only if the target of the forward wire is outside the current node. If the builders are not being called by the domain manager, the bindingMap will be null and none of the above processing will happen. I have created TUSCANY-3193 to track this issue and I would like to commit the fix described above to the 1.5.1 branch unless there are any concerns or objections. I have done a full build with this fix and everything seems OK. Simon