com.streamhub.api
Interface PublishListener
public interface PublishListener
This interface is used to receive messages published by clients.
Add your class as a PublishListener by using
SubscriptionManager.addPublishListener(PublishListener). It is
possible to get the SubscriptionManager using
NIOServer.getSubscriptionManager().
onMessageReceived
void onMessageReceived(Client client,
String topic,
Payload payload)
- This method will be called everytime a message is published
by a client to the server.
- Parameters:
client - The client who published the messagetopic - The topic the message was published onpayload - The data that was published- See Also:
Client,
Payload
Copyright © 2009 StreamHub. Tutorials, news and guides can be found on the StreamHub Comet Blog.