Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
43.3. Accessing Message Content
Accessing message headers 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Message headers typically contain the most useful message content from the perspective of a router, because headers are often intended to be processed in a router service. To access header data, you must first get the message from the exchange object (for example, using
Exchange.getIn()
), and then use the Message
interface to retrieve the individual headers (for example, using Message.getHeader()
).
Example 43.4, “Accessing an Authorization Header” shows an example of a custom processor that accesses the value of a header named
Authorization
. This example uses the ExchangeHelper.getMandatoryHeader()
method, which eliminates the need to test for a null header value.
Example 43.4. Accessing an Authorization Header
For full details of the
Message
interface, see Section 42.2, “Messages”.
Accessing the message body 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
You can also access the message body. For example, to append a string to the end of the In message, you can use the processor shown in Example 43.5, “Accessing the Message Body”.
Example 43.5. Accessing the Message Body
Accessing message attachments 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
You can access a message's attachments using either the
Message.getAttachment()
method or the Message.getAttachments()
method. See Example 42.2, “Message Interface” for more details.