Jorge Morales wrote:
Is there a way to make the endpoint of the SCA reference dynamic? We have several services (and introducing more) and would like to have a dynamicDispatch, so that in a Camel Route we select the "SCA reference endpoint" and invoke the reference. The SCAInvoker will then need to get the endpoint from a property before looking in the registry.
This is not supported. Would all the services have the same contract? I think this requirement could be handled by allowing a binding name to be specified as a context property dynamically, which would be used to select one of multiple bindings set on a composite reference.
To provide a bit more context around my last answer. The suggestion to allow for selecting one of multiple bindings is already something we've thought about and could be used to introduce dynamic dispatch within a set of statically defined candidate endpoints. It would not allow for open-ended dynamic selection, but that's a much larger cookie to swallow.
Either way would be very helpful.
Of course, to provide a list of bindings is a way, but then you have to have those bindings statically defined. To be able to dynamically dispatch to a binding endpoint (of course, contract must be the same) should be very good option. Not only in SCA binding but for any binding. Think about having multiple backend systems and applying a load balance policy when invoking those backend systems, with HTTP based transports for example.
I opened two JIRAs, the one mentioned above ([SWITCHYARD-1997] Dynamic "per message" endpoint), and ([SWITCHYARD-20110] Provide with same LoadBalanceStrategies as there are but with +WithAffinity) that is somehow related to the fact that there need to be 2 things in SwitchYard, and users/customer are heavily demaning, and are:
- Dynamic dispatch.
- Load Balance invocations (These are now possible for SCA clustered), but not for other transports.
And as I say, I already see an important demand on these. As well as the JIRA I mentioned above ([SWITCHYARD-2009] Make SCAInvoker being able to invokeLocal if the target node is "this" node on clustered invocations -…) so please, vote for them
Hi Jorge and Keith,
I also have an user demanding quite similar requirements as yours, but in this case the user wants to implement a dynamic dispatcher for endpoints with effectively different contracts, i.e. different versions (e.g. 1.0.0, 1.0.x, 1.1.0, ...) of the same service.
I provided an initial solution using RemoteInvoker directly from a Bean service, but of course we don't favour such overhead imposed by the remote invocation. Ideally, if a kind of LocalInvoker is available it should solve our problem. So long time ago we filed a RFE ( [SWITCHYARD-1678] Need feature to call from non-SwitchYard Application without HTTP protocol - JBoss Issue Tracker ) to address such a demand.
What do you Jorge and Keith think about this RFE? I believe some of the issues discussed here will be resolved by this LocalInvoker feature. And IMHO it should be better if we can swallow this larger cookie now
I fully agree with you to that this is a "must have feature" for next version of SwitchYard (2.0.0), not only this RFE that you mention, but every bit related to SCA bindings and optimizations, as this is key to many people for adoption. This means performance, and this is something that can turn the balance to SwitchYard against other products, and not having it will be a very high "cons".
I will summarize all the JIRAs that I am aware regarding SCA invocations:
- [SWITCHYARD-1678] Need feature to call from non-SwitchYard Application without HTTP protocol - JBoss Issue Tracker
- [SWITCHYARD-2135] A more aggressive optimisation for in-VM service invocation via SCA binding - JBoss Issue Tracker
- [SWITCHYARD-2128] SCAInvoker injection - JBoss Issue Tracker
- [SWITCHYARD-2009] Make SCAInvoker being able to invokeLocal if the target node is "this" node on clustered invocations -…
- [SWITCHYARD-2010] Provide with same LoadBalanceStrategies as there are but with +WithAffinity - JBoss Issue Tracker
- [SWITCHYARD-1997] Dynamic "per message" endpoint - JBoss Issue Tracker
I would love to see this being introduced into next version. I know that a lot of effort is being put on making SwitchYard work on Karaf, but there are already people using SwitchYard that expects some niceties for next release :-D