Unfortunately no (not yet).

Anyway, it's a clean Artemis installation of version 1.5.1, made by following 
the user manual instructions at 
https://activemq.apache.org/artemis/docs/1.5.1/using-server.html.

The installation was done by using a dedicated user and also the artemis java 
process runs with this dedicated user. Attached you can find my broker.xml 
configuration file: it's pretty much the same default created during the 
installation procedure, but for the acceptors (which I've customized for my 
MQTT purpose) and the addition of parameter 
"<last-value-queue>true</last-value-queue>" inside the address-setting section 
(but I tried with and without it and my issue persists).

The only other configuration I changed is the heap size dedicated to the 
process, by setting "-Xms4096M -Xmx4096M" among the JAVA_ARGS in the 
artemis.profile file.


The platform where Artemis broker is installed is:


- Machine:

It's an EC2 instance on AWS cloud of type m4.large: 2 vCPU, 8G RAM and SSD 
storage.


- OS:

CentOS Linux release 7.3.1611 (Core) - x86_64


- JVM:

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)


- Distro package version of libaio:

Arch        : x86_64
Version     : 0.3.109
Release     : 13.el7


It seems like the problem relates the Persistence (File Journal?). Until the 
broker keeps the retained messages in ram it works. When it needs to recover 
the retained messages  from the file system, clients receive them with weird 
chars.
And I suspect the same issue appears when RAM is full and messages start to be 
paged... but this case is a bit more difficult to test in a systematic way.


Francesco


________________________________
From: Clebert Suconic <clebert.suco...@gmail.com>
Sent: Tuesday, January 10, 2017 7:43 PM
To: users@activemq.apache.org
Subject: Re: MQTT retained messages with weird characters

Do you have a working test you can share?

On Tue, Jan 10, 2017 at 12:07 PM, Francesco PADOVANI
<francesco.padov...@bticino.it> wrote:
> Hello,
>
> I'm trying the Apache Artemis Broker (ver. 1.5.1) for MQTT protocol.
>
> Exactly I'm testing the retained feature for messages of MQTT protocol.
>
> While the broker is up it seems to work well:
>
> a) a client publishes a retained message to a specific topic
>
> b) any client which then subscribes that topic receives the retained message 
> (any time it re-subscribes the topic it receives the last retained message 
> ...perfect!)
>
> But it happens a strange thing when I restart the broker. And I mean I 
> restart the broker without any change on configuration: simply I make a 
> "artemis-service stop" and "artemis-service start". After The broker is up 
> and running, if a client subscribes the previous topic it still receives the 
> retained message, but with weird characters appended to it. For new retained 
> messages published it work well again... but the previous ones (before the 
> broker restart) are sent all with these weird characters. E.g., the following 
> is a retained message published before the broker restart:
>
> "test 25 for a retained message 20170110"
>
> And this is exactly how clients get it before the broker restart.
>
> Instead, after broker restart, the same retained message is received by 
> clients in the following way:
>
> test 25 for a retained message 20170110?
>                                         ? 6$sys.mqtt.retain..cro.test5 ?  
> &mqtt.message.retain ? mqtt.qos.level
>
>
> Is this my bad configuration (but I don't know ehere)? Or anything else? Or 
> what?
>
> Someone can help me?
>
>
> Thanks in advance.
>
>
> Francesco
>
> ________________________________
>
> Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir 
> des informations sensibles et/ ou confidentielles ne devant pas être 
> divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous 
> recevez ce message par erreur), nous vous remercions de le notifier 
> immédiatement à son expéditeur, et de détruire ce message. Toute copie, 
> divulgation, modification, utilisation ou diffusion, non autorisée, directe 
> ou indirecte, de tout ou partie de ce message, est strictement interdite.
>
>
> This e-mail, and any document attached hereby, may contain confidential 
> and/or privileged information. If you are not the intended recipient (or have 
> received this e-mail in error) please notify the sender immediately and 
> destroy this e-mail. Any unauthorized, direct or indirect, copying, 
> disclosure, distribution or other use of the material or parts thereof is 
> strictly forbidden.



--
Clebert Suconic

________________________________

Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir 
des informations sensibles et/ ou confidentielles ne devant pas être 
divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous 
recevez ce message par erreur), nous vous remercions de le notifier 
immédiatement à son expéditeur, et de détruire ce message. Toute copie, 
divulgation, modification, utilisation ou diffusion, non autorisée, directe ou 
indirecte, de tout ou partie de ce message, est strictement interdite.


This e-mail, and any document attached hereby, may contain confidential and/or 
privileged information. If you are not the intended recipient (or have received 
this e-mail in error) please notify the sender immediately and destroy this 
e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution 
or other use of the material or parts thereof is strictly forbidden.
<?xml version='1.0'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<configuration xmlns="urn:activemq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
               xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">

   <jms xmlns="urn:activemq:jms">
      <queue name="DLQ"/>
      <queue name="ExpiryQueue"/>

   </jms>

   <core xmlns="urn:activemq:core">

      <name>0.0.0.0</name>

      <!-- <persistence-enabled>true</persistence-enabled> -->
      <persistence-enabled>true</persistence-enabled>

      <!-- this could be ASYNCIO or NIO
       -->
      <journal-type>ASYNCIO</journal-type>

      <paging-directory>./data/paging</paging-directory>

      <bindings-directory>./data/bindings</bindings-directory>

      <journal-directory>./data/journal</journal-directory>

      <large-messages-directory>./data/large-messages</large-messages-directory>

      <journal-datasync>true</journal-datasync>

      <journal-min-files>2</journal-min-files>

      <journal-pool-files>-1</journal-pool-files>

      <!--
        You can specify the NIC you want to use to verify if the network
         <network-check-NIC>theNickName</network-check-NIC>
        -->

      <!--
        Use this to use an HTTP server to validate the network
         <network-check-URL-list>http://www.apache.org</network-check-URL-list> -->

      <!-- <network-check-period>10000</network-check-period> -->
      <!-- <network-check-timeout>1000</network-check-timeout> -->

      <!-- this is a comma separated list, no spaces, just DNS or IPs
           it should accept IPV6

           Warning: Make sure you understand your network topology as this is meant to validate if your network is valid.
                    Using IPs that could eventually disappear or be partially visible may defeat the purpose.
                    You can use a list of multiple IPs, and if any successful ping will make the server OK to continue running -->
      <!-- <network-check-list>10.0.0.1</network-check-list> -->

      <!-- use this to customize the ping used for ipv4 addresses -->
      <!-- <network-check-ping-command>ping -c 1 -t %d %s</network-check-ping-command> -->

      <!-- use this to customize the ping used for ipv6 addresses -->
      <!-- <network-check-ping6-command>ping6 -c 1 %2$s</network-check-ping6-command> -->



      <!--
       This value was determined through a calculation.
       Your system could perform 1.91 writes per millisecond
       on the current journal configuration.
       That translates as a sync write every 524000 nanoseconds
      -->
      <journal-buffer-timeout>6468000</journal-buffer-timeout>


      <!-- how often we are looking for how many bytes are being used on the disk in ms -->
      <disk-scan-period>5000</disk-scan-period>

      <!-- once the disk hits this limit the system will block, or close the connection in certain protocols
           that won't support flow control. -->
      <max-disk-usage>90</max-disk-usage>

      <!-- the system will enter into page mode once you hit this limit.
           This is an estimate in bytes of how much the messages are using in memory -->
      <global-max-size>104857600</global-max-size>

      <acceptors>
         <!-- Acceptor for every supported protocol -->
         <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE</acceptor>

         <!-- AMQP Acceptor.  Listens on default AMQP port for AMQP traffic.-->
         <!-- <acceptor name="amqp">tcp://0.0.0.0:5672?protocols=AMQP</acceptor> -->

         <!-- STOMP Acceptor. -->
         <!-- <acceptor name="stomp">tcp://0.0.0.0:61613?protocols=STOMP</acceptor> -->

         <!-- HornetQ Compatibility Acceptor.  Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
         <!-- <acceptor name="hornetq">tcp://0.0.0.0:5445?protocols=HORNETQ,STOMP</acceptor> -->

         <!-- MQTT Acceptor -->
         <!-- <acceptor name="mqtt">tcp://0.0.0.0:1883?protocols=MQTT</acceptor> -->
         <acceptor name="mqtt">tcp://172.16.2.5:1883?protocols=MQTT</acceptor>
         <acceptor name="mqtts">tcp://172.16.2.5:8883?protocols=MQTT;sslEnabled=true;needClientAuth=true;keyStorePath=/app/mqtt/activeMQ/brokers/eltbroker01/tls/brokerkeystore;keyStorePassword=changeit;trustStorePath=/app/mqtt/activeMQ/brokers/eltbroker01/tls/brokertruststore;trustStorePassword=changeit</acceptor>
         <acceptor name="mqtts2">tcp://172.16.2.5:8884?protocols=MQTT;sslEnabled=true;needClientAuth=false;keyStorePath=/app/mqtt/activeMQ/brokers/eltbroker01/tls/brokerkeystore;keyStorePassword=changeit;trustStorePath=/app/mqtt/activeMQ/brokers/eltbroker01/tls/brokertruststore;trustStorePassword=changeit</acceptor>

      </acceptors>


      <security-settings>
         <security-setting match="#">
            <permission type="createNonDurableQueue" roles="mqtt"/>
            <permission type="deleteNonDurableQueue" roles="mqtt"/>
            <permission type="createDurableQueue" roles="mqtt"/>
            <permission type="deleteDurableQueue" roles="mqtt"/>
            <permission type="consume" roles="mqtt"/>
            <permission type="browse" roles="mqtt"/>
            <permission type="send" roles="mqtt"/>
            <!-- we need this otherwise ./artemis data imp wouldn't work -->
            <permission type="manage" roles="mqtt"/>
         </security-setting>
      </security-settings>

      <address-settings>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>jms.queue.DLQ</dead-letter-address>
            <expiry-address>jms.queue.ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <last-value-queue>true</last-value-queue>
         </address-setting>
      </address-settings>
   </core>
</configuration>

Reply via email to