I have a mule flow which uses Jersey REST component
<flow name="rest-api" doc:name="rest-api">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" path="rest" port="8081" doc:name="HTTP" />
<logger message="Message !!!!!!!! #[payload]" level="INFO"
doc:name="Logger" />
<jersey:resources doc:name="REST">
<component class="com.test.api.TestAPI" />
</jersey:resources>
<logger message="Message $$$$$$$ #[payload]" level="INFO" doc:name="Logger" />
</flow>
The object past jersey component is of type "org.mule.module.jersey.MuleResponseWriter"
How to process this payload? I need to use the message and do some work on the message before returning to the invoker.
UPDATE (below)
Ref: http://www.mulesoft.org/documentation/display/current/Jersey+Module+Reference
Sending Jersey response to other flows
If you want to transform or send the request from your jersey component to next resource/flow then you need to use
ContainerResponse cr = (ContainerResponse) message.getInvocationProperty("jersey_response");
String messageString = (String) cr.getResponse().getEntity();
message.setPayload(messageString);
This will convert org.mule.module.jersey.MuleResponseWriter$1 type to String, which you can forward to your next resource.