diff --git a/native/src/main/java/io/ballerina/stdlib/java.jms/ConsumerUtils.java b/native/src/main/java/io/ballerina/stdlib/java.jms/ConsumerUtils.java index 12b84917..4e2bba74 100644 --- a/native/src/main/java/io/ballerina/stdlib/java.jms/ConsumerUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/java.jms/ConsumerUtils.java @@ -175,7 +175,7 @@ private static BMap getMessageProperties(Message message) Iterator iterator = propertyNames.asIterator(); while (iterator.hasNext()) { String key = iterator.next(); - Object value = ((MapMessage) message).getObject(key); + Object value = message.getObjectProperty(key); messageProperties.put(StringUtils.fromString(key), getMapValue(value)); } return messageProperties;