简单的helper实用程序可以轻松地发送google pubsub消息
rgpubsub的Python项目详细描述
rgpubsub
简单的助手实用程序发送谷歌pubsub消息容易。
简单用法示例
import rgpubsub
from rgpubsub import Publisher
publisher = Publisher.default_instance()
topic_name = rgpubsub.topic('testtopic')
message = {
'foo': 'bar'
}
attributes = {
'baz': 'bar'
}
publisher.publish(topic_name, message, attributes)
print('Sent message')
import rgpubsub
from rgpubsub import Publisher
publisher = Publisher.default_instance()
topic_name = rgpubsub.topic('testtopic')
message = {
'foo': 'bar'
}
attributes = {
'baz': 'bar'
}
publisher.publish(topic_name, message, attributes)
print('Sent message')