public interface Publisher
Modifier and Type | Method and Description |
---|---|
void |
asyncPublish(com.google.protobuf.ByteString topic,
PubSubProtocol.Message msg,
Callback<Void> callback,
Object context)
Publishes a message asynchronously on the given topic.
|
void |
asyncPublishWithResponse(com.google.protobuf.ByteString topic,
PubSubProtocol.Message msg,
Callback<PubSubProtocol.PublishResponse> callback,
Object context)
Publishes a message asynchronously on the given topic.
|
PubSubProtocol.PublishResponse |
publish(com.google.protobuf.ByteString topic,
PubSubProtocol.Message msg)
Publishes a message on the given topic.
|
PubSubProtocol.PublishResponse publish(com.google.protobuf.ByteString topic, PubSubProtocol.Message msg) throws PubSubException.CouldNotConnectException, PubSubException.ServiceDownException
topic
- Topic name to publish onmsg
- Message object to serialize and publishPubSubException.CouldNotConnectException
- If we are not able to connect to the server hostPubSubException.ServiceDownException
- If we are unable to publish the message to the topic.void asyncPublish(com.google.protobuf.ByteString topic, PubSubProtocol.Message msg, Callback<Void> callback, Object context)
topic
- Topic name to publish onmsg
- Message object to serialize and publishcallback
- Callback to invoke when the publish to the server has actually
gone through. This will have to deal with error conditions on
the async publish request.context
- Calling context that the Callback needs since this is done
asynchronously.void asyncPublishWithResponse(com.google.protobuf.ByteString topic, PubSubProtocol.Message msg, Callback<PubSubProtocol.PublishResponse> callback, Object context)
asyncPublish(ByteString, PubSubProtocol.Message, Callback, Object)
,
allows for the callback to retrieve PubSubProtocol.PublishResponse
which was returned by the server.topic
- Topic name to publish onmsg
- Message object to serialize and publishcallback
- Callback to invoke when the publish to the server has actually
gone through. This will have to deal with error conditions on
the async publish request.context
- Calling context that the Callback needs since this is done
asynchronously.Copyright © 2011-2014 The Apache Software Foundation. All Rights Reserved.