Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How We Can Set/Modify/Add "http.uri.params" of Inbound Properties in Mule Flow

DZone's Guide to

How We Can Set/Modify/Add "http.uri.params" of Inbound Properties in Mule Flow

A quick tutorial to modify and add existing "http.uri.params" in Mule, with code for reference.

· Integration Zone
Free Resource

Learn how API management supports better integration in Achieving Enterprise Agility with Microservices and API Management, brought to you in partnership with 3scale

Here is a brief tutorial to modify and add existing "http.uri.params" in Mule. Below is the code for reference:

1) Create Java Transformer in Mule.

2) Associate with any Java Class which extend AbstractMessageTransformer class.

3) Override "transformMessage(MuleMessage message, String outputEncoding)" in that class.

4) Use below to do the modification/addition:

ParameterMap map = message.getInboundProperty("http.uri.params");

For example, if you want to override/update/add email param in uri. Use the below URI:

map.put("email", "rohit061989@gmail.com");
message.setProperty("http.uri.params", map, PropertyScope.INBOUND);
return message;

5) Use below code to set new uri param in case "getInboundProperty("http.uri.params")" is null:

ParameterMap map = new ParameterMap();
map.put("email", "rohit061989@gmail.com");
message.setProperty("http.uri.params", map, PropertyScope.INBOUND);
return message;

Unleash the power of your APIs with future-proof API management - Create your account and start your free trial today, brought to you in partnership with 3scale.

Topics:
mule ,esb

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}