Currently, the client library is also horrible and not usable.
To give a brief implementation tips and plan,
In the experience of eclipse paho, we can add a subscribe callback when the message arrived.
i.e. the callback handler
public interface MessageCallBackHandler {
void onSuccess(Message message);
void onFailure(ErrorMessage errorMessage);
}
or we can integrate these into one function for lambda expression
@FunctionalInterface
public interface MessageCallBackHandler {
// The message ErrorMessage will be the subtype of Message.
void onComplete(Message message);
}
Further, the client will set up the callback handler and pass it into channel and related processor.
BlockClient blockClient = new BlockClient();
blockClient.setCallBack( new MessageCallBackHandler { /* implementation */ } );
This issue is not in a top priority, but may needed for the experiment in the future.
Currently, the client library is also horrible and not usable.
To give a brief implementation tips and plan,
In the experience of eclipse paho, we can add a subscribe callback when the message arrived.
i.e. the callback handler
or we can integrate these into one function for lambda expression
Further, the client will set up the callback handler and pass it into channel and related processor.
This issue is not in a top priority, but may needed for the experiment in the future.