【问题标题】:Windows Azure Servicebus Token Provider was unable to provide token, but returned an empty messageWindows Azure 服务总线令牌提供程序无法提供令牌,但返回空消息
【发布时间】:2012-03-22 14:31:03
【问题描述】:

当尝试从 Servicebus 队列接收消息时,会引发有关 Token Provider 的异常:

令牌提供程序在访问“https://xyz-sb.accesscontrol.windows.net/WRAPv0.9/”时无法提供安全令牌。令牌提供者返回消息:''。

只有当我的发行者和密钥正确时才会发生这种情况。当它们不正确时,令牌提供者会返回一条消息,描述错误所在。我会将代码添加到帖子中,直到出错为止:

string user = ConfigurationManager.AppSettings["ServiceBusUser"];
string key = ConfigurationManager.AppSettings["ServiceBusSecret"];

TransportClientEndpointBehavior securityBehaviour = new TransportClientEndpointBehavior(TokenProvider.CreateSharedSecretTokenProvider(user, key));

Uri uri = ServiceBusEnvironment.CreateServiceUri("sb", "xyz", queue);
Uri deadUri = ServiceBusEnvironment.CreateServiceUri("sb", "xyz", queue + "/$DeadLetterQueue");

if (readDeadly && allIsWell)
{
    IChannelListener<IInputChannel> deadChannelListener = messagingBinding.BuildChannelListener<IInputChannel>(deadUri, securityBehaviour);
    deadChannelListener.Open();
    IInputChannel deadInputChannel = deadChannelListener.AcceptChannel();
    deadInputChannel.Open();

    while (readDeadly && allIsWell)
    {
        FlexilineLogger.Log(logpath, "readDeadly");
        try
        {
            try
            {
                queueMessage = deadInputChannel.Receive(TimeSpan.FromSeconds(10));

并且异常发生在接收。 这昨天就像一个魅力,但今天它一直在上面抛出异常。

有没有其他人遇到过这种情况并且可能知道这个异常的原因? 或者有人对此问题有解决方案并愿意分享吗?

谢谢。

【问题讨论】:

  • 刚刚跌倒了。那仍然会发生吗?我认为它没有

标签: c# azure queue servicebus


【解决方案1】:

http://blogs.msdn.com/b/piyushjo/archive/2011/09/27/azure-service-bus-working-with-the-appfabriclabs-account.aspx

似乎是答案,尽管我正试图弄清楚如何以工人角色做到这一点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-04
    • 2018-08-05
    • 2016-08-24
    • 1970-01-01
    • 2019-05-30
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    相关资源
    最近更新 更多