clebertsuconic commented on a change in pull request #3907:
URL: https://github.com/apache/activemq-artemis/pull/3907#discussion_r782319905



##########
File path: 
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java
##########
@@ -107,120 +155,339 @@ public static String 
convertMQTTAddressFilterToCoreRetain(String filter, Wildcar
       return MQTT_RETAIN_ADDRESS_PREFIX + MQTT_WILDCARD.convert(filter, 
wildcardConfiguration);
    }
 
-   private static ICoreMessage createServerMessage(MQTTSession session,
-                                                    SimpleString address,
-                                                    boolean retain,
-                                                    int qos) {
+   private static ICoreMessage createServerMessage(MQTTSession session, 
SimpleString address, MqttPublishMessage mqttPublishMessage) {
       long id = session.getServer().getStorageManager().generateID();
 
-      CoreMessage message = new CoreMessage(id, 
DEFAULT_SERVER_MESSAGE_BUFFER_SIZE, session.getCoreMessageObjectPools());
+      CoreMessage message = new CoreMessage(id, 
mqttPublishMessage.fixedHeader().remainingLength(), 
session.getCoreMessageObjectPools());
       message.setAddress(address);
-      message.putBooleanProperty(MQTT_MESSAGE_RETAIN_KEY, retain);
-      message.putIntProperty(MQTT_QOS_LEVEL_KEY, qos);
+      message.putBooleanProperty(MQTT_MESSAGE_RETAIN_KEY, 
mqttPublishMessage.fixedHeader().isRetain());

Review comment:
       Did you consider the possibility to create a MQTTMessage?
   
   If you're not doing that now, and we plan to eventually do it.. using 
application properties from CORE wouldn't make it a bit more difficult to make 
such transition?




-- 
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]


Reply via email to