The following route has a simple goal :
Here is the code of this route :
@Component
public class TestExampleRoute extends SpringRouteBuilder {
public static final String ENDPOINT_EXAMPLE = "direct:testExampleEndpoint";
@Override
public void configure() throws Exception {
from(ENDPOINT_EXAMPLE).routeId("testExample")
.bean(TestExampleProcessor.class, "getImportDocumentProcess").id("getImportDocumentProcess")
.bean(TestExampleProcessor.class, "createImportDocumentTraitement").id("createImportDocumentTraitement")
.to("com.pack.camel.routeshowAll=true&multiline=true");
}
}
The id on the routes are not mandatory, you can use the bean strings afterwards too. However I think using ids can be considered a good practice, in case your route strings change in the future.