Reputation: 275
I have a REST service flow in Mule:
<flow name="rest-service">
<inbound-endpoint address="http://localhost:9099"/>
<logger message="API request received from #[header:INBOUND:MULE_REMOTE_CLIENT_ADDRESS]" level="INFO" />
<jersey:resources>
component class="com.example.rest.MyResource"/>
</jersey:resources>
</flow>
I want to get the MULE_REMOTE_CLIENT_ADDRESS property inside the component class MyResource
. I tried implementing MuleContextAware
but was not able to retrieve message properties from MuleContext
object.
Any other way to get the message properties? I am using Mule 3.2.0.
Upvotes: 2
Views: 420
Reputation: 33413
Use RequestContext.getEvent()
See: http://www.mulesoft.org/docs/site/3.2.0/apidocs/index.html?org/mule/RequestContext.html
Upvotes: 1