Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following code:

Code Block
from("nmr:endpoint:http://foo.bar.org/MyService/MyEndpointMyServiceEndpoint")

Automatically exposes a new endpoint to the bus , where the service QName is {http://foo.bar.orgImage Removed}MyService and the endpoint name is MyEndpoint with endpoint name MyServiceEndpoint (see #URI-format).

When an NMR endpoint appears at the end of a route, for example:

Code Block
to("nmr:endpoint:http://foo.bar.org/MyService/MyEndpointMyServiceEndpoint")

The messages sent by this producer endpoint are sent to the already deployed JBI endpoint.

Anchor
URI-format
URI-format

URI format

Code Block

nmr:service:serviceNamespace[sep]serviceName
nmr:endpoint:serviceNamespace[sep]serviceName[sep]endpointName
nmr:name:endpointName

The separator that should be used in the endpoint URL is:

  • / (forward slash), if serviceNamespace starts with http://, or
  • : (colon), if serviceNamespace starts with urn:foo:bar.

For more details of valid NMR URIs see the ServiceMix URI Guide.

Using the nmr:service: or nmr:endpoint: URI formats sets the service QName on the JBI endpoint to the one specified. Otherwise, the default Camel JBI Service QName is used, which is:

Code Block

{http://activemq.apache.org/camel/schema/jbi}endpoint

URI Options

Option

Default Value

Description

synchronous

false

When this is set to true on a consumer endpoint, an incoming, synchronous NMR Exchange will be handled on the sender's thread instead of being handled on a new thread of the NMR endpoint's thread pool

Examples

Code Block
nmr:service:http://foo.bar.org/MyService
nmr:endpoint:urn:foo:bar:MyService:MyEndpoint
nmr:endpoint:http://foo.bar.org/MyService/MyEndpoint
nmr:name:cheesefrom("nmr:MyServiceEndpoint")
from("nmr:MyServiceEndpoint?synchronous=true").to("nmr:AnotherEndpoint")

Using Stream bodies

If you are using a stream type as the message body, you should be aware that a stream is only capable of being read once. So if you enable DEBUG logging, the body is usually logged and thus read. To deal with this, Camel has a streamCaching option that can cache the stream, enabling you to read it multiple times.

Code Block
from("jbi:endpoint:http://foo.bar.org/MyService/nmr:MyEndpoint").streamCaching().to("xslt:transform.xsl", "bean:doSomething");

...