Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
A.4. Content-based Router
Overview Link kopierenLink in die Zwischenablage kopiert!
Figure A.1. Content-based Router Pattern
Example ServiceMix EIP route Link kopierenLink in die Zwischenablage kopiert!
test:echo
element is present in the message body, the message is routed to the http://test/pipeline/endpoint
endpoint. Otherwise, the message is routed to the test:recipients
endpoint.
Example A.1. ServiceMix EIP Content-based Route
Equivalent Apache Camel XML route Link kopierenLink in die Zwischenablage kopiert!
Example A.2. Apache Camel Content-based Router Using XML Configuration
Equivalent Apache Camel Java DSL route Link kopierenLink in die Zwischenablage kopiert!
Example A.3. Apache Camel Content-based Router Using Java DSL
from("jbi:endpoint:http://progress.com/demos/test/router/endpoint"). choice().when(xpath("count(/test:echo) = 1")).to("jbi:endpoint:http://progress.com/demos/test/pipeline/endpoint"). otherwise().to("jbi:service:http://progress.com/demos/test/recipients");
from("jbi:endpoint:http://progress.com/demos/test/router/endpoint").
choice().when(xpath("count(/test:echo) = 1")).to("jbi:endpoint:http://progress.com/demos/test/pipeline/endpoint").
otherwise().to("jbi:service:http://progress.com/demos/test/recipients");