I need to write a rest DSL route whose get method will retrive me from the database.Please find below code sample-
DataSource datasource= DataSourceBuilder.setupDataSource; //setting up my dataSource
bindToRegistry("myDataSource",dataSource);
rest("/generate/").get("results").consumes("application/json").route().to("direct:here");
from("direct:here)
.process(new QueryGenerator())
.to("jdbc:myDataSource?outputType=StreamList")
.split(body())
.streaming()
....
public class QueryGenerator implements Processor{
public void process(Exchange exchange) throws Exception{
exchange.getIn().setBody("select * from Employee;");
}
}
The above route is not working