Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Messaging systems
Pipeline
Anchor | ||||
---|---|---|---|---|
|
There is a simple syntax available for specifying pipeline, by simple putting to
or →
between the different steps in the pipeline.
...
The above examples also show you how other languages like XPath can be within the Scala DSL.
Recipient list
You can handle a static recipient list with a multicast or pipeline , but this EIP is usually applied when you want to dynamically determine the name(s) of the next endpoint(s) to route to. Use the recipients()
method with a function literal (Exchange => Any
) that returns the endpoint name(s). In the example below, the target endpoint name can be found in the String message starting at position 21.
Wiki Markup |
---|
{snippet:id=simple|lang=java|url=activemq/camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala} |
Because the recipients()
method just takes a function literal, you can basically use any kind of valid Scala code to determine the endpoint name. Have a look at the next example which uses pattern matching to figure out where to send the message:
Wiki Markup |
---|
{snippet:id=pattern|lang=java|url=activemq/camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala} |
Again, we can also use the same thing in a more block-like syntax. For this example, we use the Scala DSL's support for JXPath to determine the target.
Wiki Markup |
---|
{snippet:id=block|lang=java|url=activemq/camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala} |
TODO
TODO: Create a Scala alternative and example for every EIP available on http://activemq.apache.org/camel/enterprise-integration-patterns.html
- Message Channel
- Message
- Message Router
- Message Translator
- Message Endpoint
- Point to Point Channel
- Publish Subscribe Channel
- Dead Letter Channel
- Guaranteed Delivery
- Message Bus
- Correlation IdentifierRecipient List
- Aggregator
- Resequencer
- Routing Slip
- Throttler
- Delayer
- Load Balancer
- Multicast
- Content Enricher
- Content Filter
- Normalizer
- Messaging Mapper
- Event Driven Consumer
- Polling Consumer
- Competing Consumers
- Message Dispatcher
- Selective Consumer
- Durable Subscriber
- Idempotent Consumer
- Transactional Client
- Messaging Gateway
- Service Activator
- Wire Tap