Date: Tue, 19 Mar 2024 01:46:52 +0000 (UTC) Message-ID: <1413107033.53979.1710812812619@cwiki-he-fi.apache.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_53978_1491303380.1710812812619" ------=_Part_53978_1491303380.1710812812619 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The jbi component is implemented by the ServiceMix Camel module and provides integration with a J= BI Normalized Message Router, such as the one provided by Apache Se= rviceMix.
See below for information about how to use StreamSource
typ=
es from ServiceMix in Camel.
The following code:
from("jbi:end= point:http://foo.bar.org/MyService/MyEndpoint")
Automatically exposes a new endpoint to the bus, where the service QName=
is {http://foo.bar.org}MyService
and the endpoint name is
When a JBI endpoint appears at the end of a route, for example:
to("jbi:endpo= int:http://foo.bar.org/MyService/MyEndpoint")
The messages sent by this producer endpoint are sent to the already depl= oyed JBI endpoint.
jbi:service:s= erviceNamespace[sep]serviceName[?options] jbi:endpoint:serviceNamespace[sep]serviceName[sep]endpointName[?options] jbi:name:endpointName[?options]
The separator that should be used in the endpoint URL is:
/
(forward slash), if serviceNamespace
starts=
with http://
, or:
(colon), if serviceNamespace
starts with For more details of valid JBI URIs see the ServiceMix U= RI Guide.
Using the jbi:service:
or jbi:endpoint:
URI fo=
rmats sets the service QName on the JBI endpoint to the one specified. Othe=
rwise, the default Camel JBI Service QName is used, which is:
{http://activ= emq.apache.org/camel/schema/jbi}endpoint
You can append query options to the URI in the following format, ?=
option=3Dvalue&option=3Dvalue&...
jbi:service:h= ttp://foo.bar.org/MyService jbi:endpoint:urn:foo:bar:MyService:MyEndpoint jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint jbi:name:cheese
Name |
Default value |
Description |
---|---|---|
|
MEP of the Camel Exchange |
Allows users to override the MEP set on the E=
xchange object. Valid values for this option are |
|
Value of the |
Specifies the JBI operation for the |
|
|
Default value ( |
|
|
|
jbi:service:h= ttp://foo.bar.org/MyService?mep=3Din-out (override the MEP, use InOut= JBI MessageExchanges) jbi:endpoint:urn:foo:bar:MyService:MyEndpoint?mep=3Din (override the M= EP, use InOnly JBI MessageExchanges) =20 jbi:endpoint:urn:foo:bar:MyService:MyEndpoint?operation=3D{http://www.mycom= pany.org}AddNumbers=20 (overide the operation for the JBI Exchange to {http://www.mycompany.org}A= ddNumbers)
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 DE=
BUG
logging, the body is usually logged and thus read. To deal with =
this, Camel has a streamCaching
option that can cache the stre=
am, enabling you to read it multiple times.
from("jbi:end= point:http://foo.bar.org/MyService/MyEndpoint").streamCaching().to("xslt:tr= ansform.xsl", "bean:doSomething");
The stream caching is default enabled, so it is not necessary to set the=
streamCaching()
option.
We store big input streams (by default, over 64K) in a temp
f=
ile using CachedOutputStream
. When you close the input stream,=
the temp file will be deleted.
If you have some Camel routes that you want to deploy inside JBI as a Se= rvice Unit, you can use the JBI Service Unit Archetype to create a new Maven proj= ect for the Service Unit.
If you have an existing Maven project that you need to convert into a JB= I Service Unit, you may want to consult Servic= eMix Maven JBI Plugins for further help. The key steps are as follows:<= /p>
src/main/resources/camel-context.xml<=
/code> to bootstrap your routes inside the JBI Service Unit.
jbi-service-unit
.Your pom.xml
should look something like this to enable the =
jbi-service-unit
packaging:
<project x= mlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www.w3.org/2= 001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mav= en.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>myGroupId</groupId> <artifactId>myArtifactId</artifactId> <packaging>jbi-service-unit</packaging> <version>1.0-SNAPSHOT</version> <name>A Camel based JBI Service Unit</name> <url>http://www.myorganization.org</url> <properties> <camel-version>x.x.x</camel-version> <servicemix-version>3.3</servicemix-version> </properties> <dependencies> <dependency> <groupId>org.apache.servicemix</groupId> <artifactId>servicemix-camel</artifactId> <version>${servicemix-version}</version> </dependency> <dependency> <groupId>org.apache.servicemix</groupId> <artifactId>servicemix-core</artifactId> <version>${servicemix-version}</version> <scope>provided</scope> </dependency> </dependencies> <build> <defaultGoal>install</defaultGoal> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <!-- creates the JBI deployment unit --> <plugin> <groupId>org.apache.servicemix.tooling</groupId> <artifactId>jbi-maven-plugin</artifactId> <version>${servicemix-version}</version> <extensions>true</extensions> </plugin> </plugins> </build> </project>