Last active
July 23, 2016 20:09
-
-
Save bogdanalbei/b9dee18265c6d9092cec14a175f6ff15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GroceriesRouteBuilder extends RouteBuilder { | |
| public static final String VEGETABLES_QUEUE = "seda:vegetables"; | |
| public static final String FRUITS_QUEUE = "seda:fruits"; | |
| public static final String GROCERIES_QUEUE = "seda:groceries"; | |
| public static final String FRUIT_PROCESSOR = "fruitProcessor"; | |
| public static final String VEGETABLE_PROCESSOR = "vegetableProcessor"; | |
| public void configure() { | |
| from(FRUITS_QUEUE) | |
| .to(FRUIT_PROCESSOR); | |
| from(VEGETABLES_QUEUE) | |
| .to(VEGETABLE_PROCESSOR); | |
| from(GROCERIES_QUEUE) | |
| .choice() | |
| //fruits go to the fruits queue | |
| .when(body().isInstanceOf(Fruit.class)) | |
| .to(FRUITS_QUEUE) | |
| //vegetables go to the vegetables queue | |
| .when(body().isInstanceOf(Vegetable.class)) | |
| .to(VEGETABLES_QUEUE) | |
| .endChoice(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment