sedadgn commented on a change in pull request #5458:
URL: https://github.com/apache/nifi/pull/5458#discussion_r751285499
##########
File path:
nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/ConsumeAMQP.java
##########
@@ -192,6 +220,48 @@ private void addAttribute(final Map<String, String>
attributes, final String att
attributes.put(attributeName, value.toString());
}
+ private String buildHeaders(Map<String, Object> headers, boolean
escapeComma, boolean removeCurlyBraces) {
+ if (headers == null) {
+ return null;
+ }
+ if (escapeComma && removeCurlyBraces) {
+ return headers.keySet().stream()
+ .map(key -> key + "=" +
escapeString(headers.get(key).toString()))
+ .collect(Collectors.joining(", "));
+ } else if (escapeComma) {
+ return headers.keySet().stream()
+ .map(key -> key + "=" +
escapeString(headers.get(key).toString()))
+ .collect(Collectors.joining(", ", "{", "}"));
+ } else if (removeCurlyBraces) {
+ String headerString = headers.toString();
+ return headerString.substring(1, headerString.length() - 1);
Review comment:
You are right. I added the control for first and last characters
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]