Willem, Thanks, I read some of your posts in the past, they were very helpful. I appreciate your advice. My currently situation is: I used beans for complicated business logic, to send different requests to different resources and to aggregate the results in the past. But now our company is moving to cloud computing environment, our platform (modified/enhanced camel environment) moved to cloud environment. So Bean implementation is strongly discouraged since (auto/versioned) bean deployment could be very complicated in the environment.
I am moving to write all the code in groovy within the route instead of bean as best practice in our group. ProducerTemplate could be good solution if bean implementation is allowed. I tried a simple test by sending single request in groovy(I need to aggregate the final response as part of requirement, also I used setBody tag to cheat route to send request which may not be best practice): <setBody> <groovy> import org.apache.camel.ProducerTemplate import org.apache.camel.impl.DefaultProducerTemplate def template = context.createProducerTemplate() def endpoint = "myendpoint" def body = ${header.REST_REQUEST_BODY} def headers = ["Content-Type":"application/json", CamelHttpMethod:"POST"] def response = template.requestBodyAndHeader(endpoint, body, headers, java.lang.String.class) return response </groovy> </setBody> I got expected exception: context is missing since context is NOT default build-in variable. How do I get context in "simple" DSL, or how do I get a producerTemplate without using context? If not, is there other solutions/patterns that I can use for this situation without using beans? I am looking at [splitter][broadcast] pattern, but have not found way to resolve it. Maybe this is too demanding for Camel without bean: dynamic URI list, dynamic HTTP method(optional), dynamic request body(optional), and aggregate all responses. I am using Spring DSL plus groovy only, java DSL is not allowed. -- View this message in context: http://camel.465427.n5.nabble.com/recipientList-with-POST-and-request-body-tp5725142p5725192.html Sent from the Camel - Users mailing list archive at Nabble.com.