Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

URI can be used at serveral places inside ServiceMix.

Endpoint resolution

when When calling context.resolveEndpointReference(epr).
You could something like:

Code Block
java
java

        DocumentFragment epr = URIResolver.createWSAEPR("http://localhost:8192?http.soap=true");
        ServiceEndpoint se = client.getContext().resolveEndpointReference(epr);
        exchange.setEndpoint(se);
        send(exchange);
ActivationSpec
Code Block
xml
xml
<sm:activationSpec targetUridestinationUri="interface:http://www.foo.bar/MyInterface">
 ...
 </sm:activationSpec>
Code Block
xml
xml
<beans ... xmlns:my="http://servicemix.apache.org/demo/">
...
<sm:activationSpec componentName="component" service="my:service" endpoint="endpoint">
...
</sm:activationSpec>
...
</beans>
Warning

Be careful with namespaces. ServiceMix maintains an endpoint registry which it uses to look up endpoints. The example above registers the corresponding endpoint with the key:

Code Block

{http://servicemix.apache.org/demo/}serviceendpoint

However, an endpoint reference of

Code Block

http://servicemix.apache.org/demo/service/endpoint

... will result in a different, non-matching key:

Code Block

{http://servicemix.apache.org/demo}serviceendpoint

... which will ultimately cause the routing to fail.

EIP component

...

See servicemix-

...

eip.

URI syntax

The ServiceMix container can parse the following URIs:

  • interface:qname
  • Wiki Markup{{operation:qname\[sep\]name}}
  • service:qname
  • Wiki Markup{{endpoint:qname\[sep\]name}}

...

QName will be represented as: {{
namespace\[sep\]name}}

The seprator separator used will be:

  • '/' if the namespace looks like 'http://'
  • ':' if the namespace looks like 'urn:foo:bar'

...

It is up to binding components to resolve such EPR and provide an adequate ServiceEndpoint.
If used to resolve an EPR, only the endpoint: protocol can be used.

Currently, only the servicemix-http and servicemix-jms BCs are able to resolve such endpoints. 

Examples

Basic idea

Use a simple URI syntax to refer to explicit JBI endpoints. e.g.

  • bar.myqueue?jms.soap=true

Auto-creation

TODO: allow the use of URIs to expose a JBI endpoint over several transports without having to rely on creating a Service Unit for each component.

...

One of the neat things about using ActiveMQ is that once its up and running, you can refer to JMS endpoints (queues/topics) by name and things are auto-created for you by default. If required you can apply security access roles to this to prevent certain users creating new endpoints within a namespace.

...