【问题标题】:How to send and receive message to the topic of Azure Service bus in Ruby如何在 Ruby 中向 Azure 服务总线主题发送和接收消息
【发布时间】:2021-07-09 20:33:24
【问题描述】:

如何在我的 Ruby 应用程序中集成 Azure 服务总线以发送和接收来自主题的消息?

【问题讨论】:

  • 请看看这是否有帮助:example-code.com/ruby/azureServiceBus.asp.
  • @GauravMantri,感谢您的回复,但我想知道我们是否有一些更稳定的红宝石宝石,.在上面的链接中,它的第 3 方库不是来自 ruby​​ 社区
  • 我不这么认为。
  • 好的,非常感谢您的快速回复。

标签: ruby sinatra azureservicebus azure-servicebus-topics azure-servicebus-subscriptions


【解决方案1】:

​在我的 Ruby 应用程序中集成 Azure 服务总线以发送和接收来自主题的消息。请遵循以下内容:

您可以直接安装 azure ruby​​-gem 包。

gem install azure

有两种方法可以设置连接:

  1. via code
  2. via environment variables

使用以下命令发送带有消息正文的主题消息

azure_service_bus.send_topic_message(topic1, "test topic message")

要接收消息,请使用以下命令

message = service_bus.receive_subscription_message(topic1.name, subscription.name)

请参考Link to intigrate Azure service bus in your Ruby application 以完全满足您的要求。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-18
    • 2021-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多