Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistence Implementation when creating a mqtt client #18

Open
Gathika94 opened this issue Sep 26, 2017 · 0 comments
Open

Persistence Implementation when creating a mqtt client #18

Gathika94 opened this issue Sep 26, 2017 · 0 comments

Comments

@Gathika94
Copy link

Description:
In the MqttSink.java[1] class,
in the connect() method (line number 205),
an instance of MqttDefaultFilePersistence is created as persistence (line number 207).

MqttDefaultFilePersistence persistence = new MqttDefaultFilePersistence(); (207)

It is passed in as the persistence argument to the MqttClient(brokerURL, clientId, persistence) constructor (line number 211).

client = new MqttClient(brokerURL, clientId, persistence); (211)

MqttDefaultFilePersistence persist data in 'user.dir'. But when these configurations are given to an Android app, the app does not have the permissions to write in that directory. As a result it gives runtime error.

When creating a new mqtt client if null is passed in as the value for the persistence argument and it has worked correctly.

MqttClient(brokerURL, clientId, null);

So if there is a parameter in Siddhi Sink to determine which value to be passed in as the persistence argument (an instance of MqttDefaultFilePersistence or null) when a new client is creating, this issue can be overcome.

Suggested Labels:
Android, Siddhi, Mqtt

OS, DB, other environment details and versions:
Android OS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant