def myHeader = message.getHeader("MyHeader")
To Retrieve a specific header value from the incoming message object.
In many message-based systems (like REST, SOAP, messaging queues, etc.), headers carry metadata about the message — such as routing info, content type, user ID, timestamps, etc. These are not part of the message body, but still crucial for processing logic.
message.setHeader("NewHeader", "HeaderValue")
Routing & Control: Headers guide message flow (e.g., for routing or filtering).
Protocol Metadata: Required for HTTP/SOAP (e.g., Content-Type, Authorization).
Non-invasive Info Passing: Add extra data without modifying the message body.
No comments:
Post a Comment