我正在学习PubSub API。我向主题发布了一些消息,当我使用API Explorer进行订阅者拉动
时 Method: projects.subscriptions.pull
数据似乎与我实际发布的数据不符:
我发布的内容:"Message number 13
API资源管理器返回的内容是:NTlkMjdhYzQtZTUyZi00M2Q3LTk0ZTItNTZhNTM1ZGRlODNk
(附上屏幕截图)
奇怪的是,当使用实际的API(Python客户端库)进行子提取时,一切都很好:
subscriber = pubsub_v1.SubscriberClient()
subscription_path = subscriber.subscription_path(PROJECT_ID, SUBSCRIPTION)
messages = subscriber.pull(subscription_path, max_messages=10, timeout=10, return_immediately=True)
print(messages.received_messages[0])
ack_id:“ QV5AEkw2AERJUytDCypYEU4EISE-MD5FU0RQBhYsXUZIUTcZCGhRDk9eIzzICICFEFETE1FcdhNaEGszXHUHUQ0YdHhncGgOQFMAEFl-VVsJPGhJ9BZHZY5QWZJ5Y
消息
{数据:“消息号13”
message_id:“ 176868380899521”
publish_time {
秒:1535000824
nanos:625000000
}}