Microsoft Azure服务总线/事件中心:没有消息,只有请求 [英] Microsoft Azure Service Bus/Event Hub: No messages, only requests

查看:136
本文介绍了Microsoft Azure服务总线/事件中心:没有消息,只有请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过HTTP POST向我的Azure Event Hub发送消息(以与IoT Hub和Blob存储一起使用).

I'm sending messages through HTTP POST to my Azure Event Hub (to use with IoT Hub and a Blob storage).

这些是HTTP调用的设置:

These are the HTTP call's settings:

每次发送消息时,我都会收到请求,但没有消息.

Every time I send a message, I get a request, but no message.

我尝试过:

  • 不同的SAS密钥和所有者
  • 不同的标题,也没有标题

我找到此问题. 我还确保按照那里的建议检查权限,但是已经将它们设置为必要的级别.

I've added the headers after finding this question. I also made sure to check the permissions, as it was suggested there, but they were already set to the necessary level.

值得注意的是:由于某种原因,它在原始设置下只能工作一次(第一张图像上标记为黄色).

Noteworthy: for some reason, it did work once with the original settings (marked in yellow on the first image).

我的问题:
1.是否需要手动添加具有相同名称的服务总线端点? 我假设当您创建事件中心时,它会自动创建 为您服务的巴士.
2.可能是我看到的请求实际上与我发送的消息无关吗?
3.我配置错了吗?

My questions:
1. Do I need to manually add a service bus endpoint with the same name? I'm assuming when you create an event hub, it automatically creates the service bus for you.
2. Could it be the requests I'm seeing actually have nothing to do with the messages I'm sending?
3. Am I configuring this wrong?

推荐答案

在进行了更多研究并尝试了不同的方法之后,这似乎是对我有用的方法:

After doing some more research and trying out different methods, this seems to be the one that works for me:

作为端点,您需要使用

https://{servicebus-name}.servicebus.windows.net/{eventhub-name}/messages

而不是

https://{servicebus-name}.servicebus.windows.net/

内容类型和内容编码标头以及其他标头似乎是必需的:

The content-type and content-encoding headers seem to be necessary as well as another header:

host: {servicebus-name}.servicebus.windows.net;

在Microsoft文档中,他们添加了略有不同的标题并使用了不同的URL,但这对我不起作用. 这样.

In the Microsoft Docs they add slightly different headers and use a different URL, but that doesn't work for me. This does.

要回答我自己的问题,以防将来可能对某人有所帮助:

To answer my own questions in case it can help someone in the future:

  1. 是否需要手动添加具有相同名称的服务总线端点?我假设您在创建事件中心时会自动为您创建服务总线.

您不需要手动添加服务总线,但是您无法配置为您自动创建的服务总线. SharedAccessAuthorizationRules仅可应用于名称空间及其子项,将它们直接应用于服务总线为

  • 可能是我看到的请求实际上与我发送的消息无关吗?
  • 并非所有请求都是消息,这很正常,但是在监视活动之后,它确实指出我收到的请求与我发送消息的设备直接相关.

    1. 我配置错了吗?

    是的.

    这篇关于Microsoft Azure服务总线/事件中心:没有消息,只有请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆