Created
March 3, 2014 14:04
-
-
Save tjsnell/9325570 to your computer and use it in GitHub Desktop.
This file contains 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("cxfrs:http://0.0.0.0:9090?resourceClasses=cc.notsoclever.examples.CompanyService&bindingStyle=SimpleConsumer") | |
.choice() | |
.when(header("operationName").isEqualTo("getCompany")) | |
.to("sql:SELECT * from company where id = :#id") | |
.when(header("operationName").isEqualTo("createCompany")) | |
.to("sql:INSERT INTO company(name, symbol) VALUES (:#name, :#symbol)") | |
.when(header("operationName").isEqualTo("getCompanies")) | |
.to("sql:select * from company") | |
.when(header("operationName").isEqualTo("updateCompany")) | |
.to("sql:UPDATE company SET name = :#name, symbol = :#symbol where id = :#id") | |
.when(header("operationName").isEqualTo("deleteCompany")) | |
.to("sql:DELETE FROM company where id = :#id") | |
.end() | |
.marshal().json(JsonLibrary.Jackson); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment