1 of 1 people found this helpful
Have you checked RemoteInvoker ? I believe this is the closest equivalent to JBoss ESB's ServiceInvoker.
Hope this helps,
I agree with the comment on RemoteInvoker, but wanted to follow up with a few more comments.
The @ServiceOperation annotation you referenced in your post is actually just for unit tests. If you want to refer to another service from within a CDI Bean service, then you can use @Reference:
As a general rule, we attempt to encourage declaration of dependencies in a service through reference definitions in the application metadata. The choice of which service can be dynamic, but the set of services to choose is static. If you want 100% dynamic, then RemoteInvoker is the ticket. One thing to keep in mind is that any service invoked via RemoteInvoker must have a binding.sca defined. You can see an example of this in the RemoteInvoker quickstart.
Thanks for the clarification of @ServiceOperation vs @Reference. I had wondered at one point what the distinction was.
Regarding design, I agree with the notion that the choosing of which service is dynamic but the set of services to choose from is static. I am just using a database meta-data driven approach to both define what services are available on the ESB as well determining which service will be called for a particular service definition.
I chose this approach primarily because most of the routing logic I found required introspection of the inbound payload to determine where to route the request. I didn't want the routing logic having to introspect or force clients to adopt a convention to send along a particular routing token within their custom payloads. In other words, the target service knows how to handle the payload, but all the infrastructure in front of that service doesn't need to.
This is what made the ServiceInvoker nice in the JBoss ESB in that it wasn't just useful for invoking remote services, but it also gave me a way to jump across pipelines in a such a way that the calling pipeline had no dependency at all on the target. It funtioned more like a proxy.
I will certainly take a look at the RemoteInvoker even though I'm looking to basically call, in JBossESB speak, "InVM" not necessarily remotely.