|
Page Edited :
CAMEL :
Dynamic Router
Dynamic Router has been edited by James Strachan (Oct 01, 2008). Content:Dynamic RouterThe Dynamic Router The simplest way to implement this is to use the RecipientList Annotation on a Bean method to determine where to route the message. public class MyDynamicRouter {
@Consume(uri = "activemq:foo")
@RecipientList
public List<String> route(@XPath("/customer/id") String customerId, @Header("Location") String location, Document body) {
// query a database to find the best match of the endpoint based on the input parameteres
...
}
}
In the above we can use the Parameter Binding Annotations to bind different parts of the Message to method parameters or use an _expression_ such as using XPath or XQuery. The method can be invoked in a number of ways as described in the Bean Integration such as
Using This PatternIf you would like to use this EIP Pattern then please read the Getting Started, you may also find the Architecture useful particularly the description of Endpoint and URIs. Then you could try out some of the Examples first before trying this pattern out. |
Unsubscribe or edit your notifications preferences
