tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anuj Bhatia <anujbha...@gmail.com>
Subject Re: Dynamic service references ?
Date Wed, 23 Nov 2011 12:11:09 GMT
As a user I would love to see this feature. We had a similar problem
in our project, see [1].

The way we solved it was to write a custom policy filter that looks up
service endpoint URIs from a database at run time and sets those URIs
on a Binding object on the 'to' Endpoint on the Message object that
comes as a parameter to the policy interceptor. This works because the
binding implementation that we use (axis2 ws binding) gives preference
to the URI set on the Message object over the URI set via the URI
attribute in the composite XML file.

But this isn't an ideal situation as this behavior of the binding
implementation is not documented/guaranteed. In fact we found that the
binding.rest implementation does not work this way, so we had to fork
the binding.rest code and make a private build to get it to work with
our custom policy interceptor.

I'm sure there are a whole lot of other problems with our approach
that we haven't discovered yet :-)

I would love to have a standard SCA (or at least a standard Tuscany)
way of doing this.

Thanks
Anuj

[1] http://mail-archives.apache.org/mod_mbox/tuscany-user/201108.mbox/%3CCANDkLWeojEuKV=qZSw8D4xFWe0nOH8xxAxoF6R_5-fpoNtrGcw@mail.gmail.com%3E


On Wed, Nov 23, 2011 at 3:17 PM, ant elder <ant.elder@gmail.com> wrote:
>
> On Tue, Nov 22, 2011 at 1:51 PM, Simon Laws <simonslaws@googlemail.com> wrote:
> > On Fri, Nov 18, 2011 at 2:38 PM, Millies, Sebastian
> > <Sebastian.Millies@softwareag.com> wrote:
> >>
> >>
> >>> -----Original Message-----
> >>> From: Simon Laws [mailto:simonslaws@googlemail.com]
> >>> Sent: Friday, November 18, 2011 2:15 PM
> >>> To: user@tuscany.apache.org
> >>> Subject: Re: Dynamic service references ?
> >>>
> >> [snip]
> >>> Hi Sebastien
> >>>
> >>> I'm not clear about whether you have a finite number of target service
> >>> that you know up front from which you want to select dynamically. Or
> >>> whether you don't know the service endpoints but you just know the
> >>> service interface.
> >>>
> >>> Regards
> >>>
> >>> Simon
> >>>
> >>> --
> >>> Apache Tuscany committer: tuscany.apache.org
> >>> Co-author of a book about Tuscany and SCA: tuscanyinaction.com
> >>
> >> It is the latter: I'm facing an undetermined number of identical services.
> >> I know the service interface (the wsdl of an SAP web service), but I do not
> >> know in advance which endpoint to talk to.
> >>
> >> -- Sebastian
> >>
> >> IDS Scheer Consulting GmbH
> >> Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
> >> Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany
- Registergericht/Commercial register: Saarbrücken HRB 19681
> >> http://www.softwareag.com
> >>
> >>
> >
> > I don't have a good immediate answer and I don't want to distract you
> > and Simon from investigating what can be done with service references
> > (hence the delay) however two thoughts come to mind.
> >
> > Mike Edwards reminded me that there is a wiredByImpl flag in SCA that
> > we don't exploit in Tuscany today. This is what the OASIS spec says
> > about it:
> >
> > 351 • wiredByImpl : boolean (0..1) - a boolean value, "false" by
> > default. If set to "false", the reference is
> > 352 wired to the target(s) configured on the reference. If set to
> > "true" it indicates that the target of the
> > 353 reference is set at runtime by the implementation code (e.g. by
> > the code obtaining an endpoint
> > 354 reference by some means and setting this as the target of the
> > reference through the use of
> > 355 programming interfaces defined by the relevant Client and
> > Implementation specification).
> >
> > This doesn't indicate how that might me achieved though as it would be
> > runtime specific. We'd probably have to do something similar to what
> > you're already looking at, i.e. allow the service reference to be
> > retrieved and allow it's model to be edited and restarted.
> >
> > Something that could be possible already in 2.x is to use the domain
> > registry to dynamically route based on SCA target name. This would
> > rely on having the target services contributed to the SCA domain and
> > then using the SCAClient interface to look them up. I.e. it doesn't
> > present a mechanism for manually configuring binding.ws with a URI.
> >
> > Both of these things are future things but if the current
> > investigations get stuck they present avenues for further
> > investigation.
> >
>
> FWIW I think this would be a terrific function for us to add. Users
> have been asking for it over and over again for years now in Tuscany
> so theres clearly a desire for it.
>
>   ...ant

Mime
View raw message