Hello all,
Suppose I have a method to expose via REST:
@GET
@Path("/doSomething")
public Response doSomething(@QueryParam("foo") String foo,
@QueryParam("bar") String bar) {..}
Then wired in Spring XML as:
<camelCxf:rsServer id="someBean" address="/somePath"
serviceClass="org.some.package.SomeService"/>
Then added to a route as:
from("cxfrs:bean:someBean").process(..)
===========================================
When I reach the processor, the exchange body is a MessageContentsList
containing the values passed for "foo" and "bar". Is there a way to retrieve
these query params via their annotated names, either by some TypeConverter or
header property? I'm not guaranteed that the callers will pass these
parameters ordered as they are in the method signature, so iterating over the
MessageContentsList is tricky if the params are of the same type, or if not all
the parameters were provided.
Alternatively, I could inspect the CamelHttpQuery header in my processor and
construct a Map, but I'm curious if there's configuration, TypeConverters, or
other ways to achieve this, out-of-the-box.
Thanks,
Matt