👉 Accessing attributes from message in Mule 4

How to access "attributes" from the Mule message payload in Mule 4?


Following the new Mule Message structure, the HTTP listener now provides all request metadata through specific HTTP Request Attributes.

Access the HTTP header metadata information from message payload in Mule 4 and Mule 3




MetadataMule 3Mule 4

Method



#[inboundProperties.'http.method']



#[attributes.method]



Path



#[inboundProperties.'http.listener.path']



#[attributes.listenerPath]



Relative Path



#[inboundProperties.'http.relative.path']



#[attributes.relativePath]



Request URI



#[inboundProperties.'http.request.uri']



#[attributes.requestUri]



Query String



#[inboundProperties.'http.query.string']



#[attributes.queryString]



Query Parameters



#[inboundProperties.'http.query.params']



#[attributes.queryParams]



URI Parameters



#[inboundProperties.'http.uri.params']



#[attributes.uriParams]



Version



#[inboundProperties.'http.version']



#[attributes.version]



Scheme



#[inboundProperties.'http.scheme']



#[attributes.scheme]



Headers



#[inboundProperties]



#[attributes.headers]



Remote Address



#[inboundProperties.'http.remote.address']



#[attributes.remoteAddress]



Client Certificate



#[inboundProperties.'http.client.cert']



#[attributes.clientCertificate]




A clear difference in accessing metadata information from the payload in Mule 3 and Mule 4
  • Mule 3: #[inboundProperties.'host']

  • Mule 4: #[attributes.headers.'host']

Accessing HTTP Response Attributes from Mule 3 and Mule 4 message

How to get HTTP status code from Mule 4 message. This is a full article

Status Code



#[inboundProperties.'http.status']



#[attributes.statusCode]



Reason Phrase



#[inboundProperties.'http.reason']



#[attributes.reasonPhrase]



Headers



#[inboundProperties]



#[attributes.headers]


Best Mulesoft free video tutorials of Mule 3 version. If you are a beginner to Mulesoft and want to start learning from previous versions of Mule. Below are good sources for Mule 3 free tutorials. Currently, Mule 4.2 is in the market. There are many changes when compared to its previous stable version which is Mule 3.9 , Anypoint Studio 6.x version. We have collected the best tutorials available on Mulesoft and placed them here for a quick and easier understanding of Mule capabilities. Let’s get started quickly with a brief intro on the changes that took place from Mule 3 to Mule 4 version

Post a Comment

0 Comments