Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Java best practive having subscriber + publisher object

Thanks to both of you.

MemoryPersistence solved my problem with "Persistence already in use (32200)" error and changing clientId to uniques made the connections stay alive.

best regards
alex

Am 08.05.2014 20:30, schrieb Parth Pandya:
Try using MemoryPersistence instead of File Persistence this will do


On Thu, May 8, 2014 at 11:36 PM, Marc L Cohen <mlcohen@xxxxxxxxxx> wrote:

Sounds like you are using the same ClientID for both. Problem is, if the
persistence allowed you to do that, the server would disconnect the first
client when it connects the second one. You need to use different ClientIDs
for each client. The persistence directory name is based on a combination
of the ClientID and the server identification.


Marc L. Cohen
MessageSight Test/Development
Internet:mlcohen@xxxxxxxxxx
also at:teddybbear@xxxxxxx
(512) 286-5744 (T/L 363-5744)
FAX (512) 973-4293

[image: Inactive hide details for "paho@xxxxxxxxxx" ---05/08/2014 12:19:52
PM---Hi all, I have a subscriber thread and wanted to implem]"
paho@xxxxxxxxxx" ---05/08/2014 12:19:52 PM---Hi all, I have a subscriber
thread and wanted to implement a static publisher.

From: "paho@xxxxxxxxxx" <paho@xxxxxxxxxx>
To: paho-dev@xxxxxxxxxxx
Date: 05/08/2014 12:19 PM
Subject: [paho-dev] Java best practive having subscriber + publisher
object
Sent by: paho-dev-bounces@xxxxxxxxxxx
------------------------------



Hi all,

I have a subscriber thread and wanted to implement a static publisher.
Now I am getting a "Persistence already in use (32200)" error, because I
am using the same Persistence.

Therefor I have some questions now:
What is "MqttDefaultFilePersistence dataStore = new
MqttDefaultFilePersistence(tmpDir);" good for?
Do I really need this?

And last but not least: What is a good handling to get around with it? I
read something about MqttDefaultFilePersistence().open() ... but don't
have an idea how to handle/ use it.

If you have concerns about my usage, I am free to change it. A little
example would be great. Maybe you have some good example blog entry or
similar.
To get a better view on it, here are my subscriber
(https://gist.github.com/cygairko/78422c072a3065a83607) and publisher
(https://gist.github.com/cygairko/621ebf14b3d1a47e09f6) (or what I have
by now).

Thanks in advance for your help.

Best regards
Alex
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev





_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev


Back to the top