Created
October 11, 2015 18:56
-
-
Save malalanayake/61ecec3a040dfbf44ceb 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
package camel.routing.config; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.spring.javaconfig.CamelConfiguration; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
/** | |
* Route Configuration | |
* | |
* @author malalanayake | |
* | |
*/ | |
@Configuration | |
public class RouteConfig extends CamelConfiguration { | |
@Autowired | |
Config config; | |
/** | |
* Message processing route | |
* | |
* @return | |
*/ | |
@Bean | |
RouteBuilder messageProcessingRoute() { | |
return new RouteBuilder() { | |
@Override | |
public void configure() throws Exception { | |
from("jms:queue:" + config.queueName).to("messageProcessor").routeId("mySampleRoute"); | |
} | |
}; | |
} | |
/** | |
* Expose all routes | |
*/ | |
@Override | |
public List<RouteBuilder> routes() { | |
return Arrays.asList(messageProcessingRoute()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment