INT-4284: Remove info about readOnly headers

JIRA: https://jira.spring.io/browse/INT-4284

**Cherry-pick to 4.3.x**
This commit is contained in:
Artem Bilan
2017-06-15 10:33:21 -04:00
committed by Gary Russell
parent 4a47a7ce45
commit fab0f5478f
2 changed files with 4 additions and 6 deletions

View File

@@ -188,11 +188,9 @@ public final class MessageBuilder<T> extends AbstractIntegrationMessageBuilder<T
public MessageBuilder<T> copyHeadersIfAbsent(Map<String, ?> headersToCopy) {
if (headersToCopy != null) {
for (Map.Entry<String, ?> entry : headersToCopy.entrySet()) {
if (!this.headerAccessor.isReadOnly(entry.getKey())) {
this.headerAccessor.setHeaderIfAbsent(entry.getKey(), entry.getValue());
}
else if (logger.isInfoEnabled()) {
logger.info("The header [" + entry + "] is ignored for population because it is is readOnly.");
String headerName = entry.getKey();
if (!this.headerAccessor.isReadOnly(headerName)) {
this.headerAccessor.setHeaderIfAbsent(headerName, entry.getValue());
}
}
}

View File

@@ -373,7 +373,7 @@ In addition to the default strategy, two additional `IdGenerators` are provided;
[[read-only-headers]]
===== Read-only Headers
The `MessageHeaders.ID` and `MessageHeaders.TIMESTAMP` are read-only headers and the cannot be overridden.
The `MessageHeaders.ID` and `MessageHeaders.TIMESTAMP` are read-only headers and they cannot be overridden.
Since _version 4.3.2_, the `MessageBuilder` provides the `readOnlyHeaders(String... readOnlyHeaders)` API to customize a list of headers which should not be copied from an upstream `Message`.
Just the `MessageHeaders.ID` and `MessageHeaders.TIMESTAMP` are read only by default.