← Back to team overview

mosquitto-users team mailing list archive

Re: How to persist message in mosquitto

 

Hi,

I would expect that you don't have permission to write to C:

Try running it without setting persistence_location and from a
directory where you have write permission.

Cheers,

Roger


On Fri, Aug 2, 2013 at 7:48 AM, 灰(Grey)狼 <86267306@xxxxxx> wrote:
>  I am newbie in mosquitto , I installed mosquitto-1.1.2-install-win32.exe in
> win7-64 system. When I want to use mosquitto persistent feature , I found no
> mosquitto.db is created.  I have modified everyting i Know , but not works.
> Any help will be appreciated :D .  the Attachment  is my config file.below
> is some test java code:
>
> pub message:
>
>   MqttClient client = new MqttClient("tcp://localhost:1883",
> "SampleClient");
>   client.connect();
>   MqttMessage message = new MqttMessage("Hello world11".getBytes());
>   message.setQos(1);
>   while(true){
>    client.getTopic("sensors/temperature").publish(message);
>    Thread.sleep(1000);
>   }
>
>
> sub message:
>
>    new Thread(new Runnable(){
>     public void run() {
>      // TODO Auto-generated method stub
>      final String clientname = String.valueOf(Math.random());
>      try {
>       MqttClient client = new MqttClient("tcp://localhost:1883",
> clientname);
>       client.connect();
>       while(true){
>        SimpleCallbackHandler simpleCallbackHandler = new
> SimpleCallbackHandler();
>              client.setCallback(simpleCallbackHandler);
>        client.subscribe("sensors/temperature",0);
>        Thread.sleep(1000);
>       }
>      } catch (Exception e) {
>       // TODO Auto-generated catch block
>       e.printStackTrace();
>      }
>     }
>    }).start();
>
> --
> Mailing list: https://launchpad.net/~mosquitto-users
> Post to     : mosquitto-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mosquitto-users
> More help   : https://help.launchpad.net/ListHelp
>


References