diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java index a6d531a978..fe09a39a94 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AbstractControl.java @@ -106,8 +106,8 @@ public abstract class AbstractControl extends StandardMBean { try { CoreMessage message = new CoreMessage(storageManager.generateID(), 50); if (headers != null) { - for (String header : headers.keySet()) { - message.putStringProperty(new SimpleString(header), new SimpleString(headers.get(header))); + for (Map.Entry header : headers.entrySet()) { + message.putStringProperty(new SimpleString(header.getKey()), new SimpleString(headers.get(header.getValue()))); } } message.setType((byte) type);