我正在将一些数据推送到Google Pub Sub中的主题。 以下代码将消息推送到主题:
PublishResponse response = client.Publish(topic, messages);client是PublisherClient , message是PubSubMessage 。
现在这个response对象没有告诉我发布是否成功。 我查看了API文档: https : //googlecloudplatform.github.io/google-cloud-dotnet/docs/Google.Cloud.PubSub.V1/api/Google.Cloud.PubSub.V1.PublishResponse.html
但没有帮助。 我正处于一个大项目的中间,因此我无法运行此代码并检查我可以在response对象中获得的所有值。
因此,如果有人可以对这个神秘物体PublishResponse
I am pushing some data to a topic in Google Pub Sub. Following code pushes a message to the topic:
PublishResponse response = client.Publish(topic, messages);client is PublisherClient and message is a PubSubMessage.
Now this response object doesn't tell me if the publish was successful or not. I check the API docs: https://googlecloudplatform.github.io/google-cloud-dotnet/docs/Google.Cloud.PubSub.V1/api/Google.Cloud.PubSub.V1.PublishResponse.html
But no help. I am in the middle of a big project, thus I can't run this code and check what all values I can get in response object.
Thus it will be great if someone can shed some light on this mystic object PublishResponse
最满意答案
如果出现故障,Publish方法将抛出异常。
The Publish method will throw an exception if something fails.
更多推荐
发布评论