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

Listener deprecated but not documented #71

Open
francisdb opened this issue Jun 6, 2016 · 6 comments
Open

Listener deprecated but not documented #71

francisdb opened this issue Jun 6, 2016 · 6 comments

Comments

@francisdb
Copy link

org.fusesource.mqtt.client.Listener is annotated with @Deprecated but there is no reference to the new way of doing things

@kegeman
Copy link

kegeman commented Oct 10, 2017

This is still the issue...

3 similar comments
@kurrunk37
Copy link

This is still the issue...

@calcao
Copy link

calcao commented Jun 5, 2018

This is still the issue...

@cnazev
Copy link

cnazev commented Oct 19, 2018

This is still the issue...

@leonpros
Copy link

leonpros commented Sep 3, 2019

any news on that?

@lvskk
Copy link

lvskk commented Oct 23, 2020

Just to close the issue.

org.fusesource.mqtt.client.Listener was deprecated in favor of org.fusesource.mqtt.client.ExtendedListener.

The new usage as I could understand from the code is as follows (please, correct me if I'm wrong):

    connection.listener(new ExtendedListener() {
        public void onPublish(UTF8Buffer utf8Buffer, Buffer buffer, Callback<Callback<Void>> callback) {
            callback.onSuccess(new Callback<Void>() {
                public void onSuccess(Void aVoid) {
                    System.out.println(new String(buffer.toByteArray()));
                }
                public void onFailure(Throwable throwable) {}
            });
        }
        public void onDisconnected() {}
        public void onConnected() {}
        public void onPublish(UTF8Buffer topic, Buffer payload, Runnable ack) {}
        public void onFailure(Throwable value) {
            value.printStackTrace();
        }
    });

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

7 participants