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
Metadata | Mule 3 | Mule 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 articleStatus Code | #[inboundProperties.'http.status'] | #[attributes.statusCode] |
Reason Phrase | #[inboundProperties.'http.reason'] | #[attributes.reasonPhrase] |
Headers | #[inboundProperties] | #[attributes.headers] |
0 Comments