jbertram commented on a change in pull request #3907:
URL: https://github.com/apache/activemq-artemis/pull/3907#discussion_r782351849
##########
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:
I didn't seriously consider implementing a native MQTTMessage at this
point. My goal in this PR was to correctly implement all the new MQTT 5
features.
We've always used message properties when converting to/from core for
MQTT-specific details. This PR isn't changing that. I'm not clear on how this
would make the transition to a native MQTTMessage implementation more difficult
later. Can you elaborate on that?
--
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]