Created
August 2, 2012 11:41
-
-
Save bibryam/3236471 to your computer and use it in GitHub Desktop.
Camel Olympics Image Loader Route
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 void configure() throws Exception { | |
| from("twitter://streaming/filter?type=event&keywords=" + searchTerm) | |
| .to("log:tweetStream?level=INFO&groupInterval=60000&groupDelay=60000&groupActiveOnly=false") | |
| .process(new ImageExtractor()) | |
| .process(new Statistics()) | |
| .filter(body().isInstanceOf(Tweet.class)) | |
| .idempotentConsumer(header(UNIQUE_IMAGE_URL), MemoryIdempotentRepository.memoryIdempotentRepository(10000)) | |
| .to("log:imageStream?level=INFO&groupInterval=60000&groupDelay=60000&groupActiveOnly=false") | |
| .throttle(1).timePeriodMillis(5000).asyncDelayed().callerRunsWhenRejected(false) | |
| .marshal().json(JsonLibrary.Jackson) | |
| .to("websocket:camelympics?sendToAll=true"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment