public interface OutgoingMessage extends IncomingMessage
OutgoingMessage
includes methods for setting the body (payload) of the message as well as the metadata, such as transport-level headersModifier and Type | Method and Description |
---|---|
Body |
getOrDefaultBody()
Returns the body of the outgoing message to be sent out
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getOrDefaultHeaders()
Returns the entire set of transport-level headers to be used for outgoing message.
|
OutgoingMessage |
setBody(Body body)
Lets the caller set the body of the outgoing message
|
OutgoingMessage |
setHeader(java.lang.String name, java.lang.String value)
Adds or overrides a transport-level header with a given name for outgoing message
|
OutgoingMessage |
setHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
Overrides the entire set of transport-level headers to be used for outgoing message with the given map
|
OutgoingMessage |
withoutHeader(java.lang.String name)
Send the message without this header.
|
getBody, getHeader, getHeaders
OutgoingMessage setBody(Body body) throws java.io.IOException
body
- an object that represents the body (payload)OutgoingMessage
instancejava.io.IOException
- if there was an error setting the bodyBody getOrDefaultBody() throws java.io.IOException
java.io.IOException
- if there was an error setting the bodyOutgoingMessage setHeader(java.lang.String name, java.lang.String value)
name
- name of the headervalue
- value to setOutgoingMessage
instanceOutgoingMessage setHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
headers
- map of the headers, keyed by header nameOutgoingMessage
instancejava.util.Map<java.lang.String,java.util.List<java.lang.String>> getOrDefaultHeaders()
OutgoingMessage withoutHeader(java.lang.String name)
name
- name of the headerOutgoingMessage
instance