Reputation: 143
I am new to Mule. My question is how to extract HTTP parameters inside a java component. I tried this in Java class of Mule application. The query param name is id But it's not actually working So far I tried the following: ---
MuleMessage message = eventContext.getMessage();
String id = message.getInboundProperty("id");
I am getting null value. How to extract that in Java class. An example will be great
Upvotes: 0
Views: 408
Reputation: 8321
This is very easy. You can use following in your Java:
MuleMessage muleMessage = eventContext.getMessage();
Map<String, String> queryParams = muleMessage.getInboundProperty("http.query.params");
String id=queryParams.get("id");
System.out.println(id);
return muleMessage;
Upvotes: 4