activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (ARTEMIS-1244) [mqtt] Retain flag of received message is lost (caught by outgoing interceptor)
Date Thu, 22 Jun 2017 10:16:02 GMT


ASF GitHub Bot commented on ARTEMIS-1244:

Github user jdanekrh commented on a diff in the pull request:
    --- Diff: artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/
    @@ -256,6 +258,7 @@ void handlePubAck(int messageId) throws Exception {
        private void sendServerMessage(int messageId, CoreMessage message, int deliveryCount,
int qos) {
           String address = MQTTUtil.convertCoreAddressFilterToMQTT(message.getAddress().toString(),
    +      boolean isRetain = message.getBooleanProperty(new SimpleString(MQTT_MESSAGE_RETAIN_KEY));
    --- End diff --
    I thought about it, and my conclusion was that since `getBooleanProperty` starts like
       ... Boolean getBooleanProperty(final SimpleString key) throws ... {
          Object value = doGetProperty(key);
          if (value == null) {
             return Boolean.valueOf(null);
    then the only way to get `null` for isRetain would be if somebody explicitly stored a
`null` `Boolean` into the `MQTT_MESSAGE_RETAIN_KEY` property. In which case I though passing
the `null` along is appropriate.
    Are you suggesting to do something like
        isRetain = Boolean.valueOf(message.getBooleanProperty(...))
    to be extra sure? I guess it can do no harm adding it... I'll try do it in CET evening

> [mqtt] Retain flag of received message is lost (caught by outgoing interceptor)
> -------------------------------------------------------------------------------
>                 Key: ARTEMIS-1244
>                 URL:
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: MQTT
>    Affects Versions: 2.1.0
>            Reporter: Michal Toth
>            Priority: Minor
> Upstream test: testCheckInterceptedMQTTMessageProperties] [|org/apache/activemq/artemis/tests/integration/interceptors/
> Asked for PR.
> While implementing an upstream test and checking MQTT Outgoing interceptor, I have noticed
that retain flag set to true is being lost when sending message out.
> However I did not manage to get information about this specific in [ Retain|].
> On the other hand I have found a sentence in [HiveMQ|]
part 8 article:
> {quote}
> Also the subscribing client can identify if a received message was a retained message
or not, because the broker sends out retained messages with the retained flag still set to
> {quote}
> So after all this might be a matter of implementation. (feature enhancement or rejected

This message was sent by Atlassian JIRA

View raw message