StreamInsight Austin示例服务总线404

时间:2012-11-19 09:37:56

标签: azure servicebus streaminsight azureservicebus

我一直在尝试基于Austin Sample创建一个示例应用程序。首先,我有一个带样本的404,我通过调整App.Config中的connectionString来修复它(我忘了那个,我的坏)。 现在我已经创建了第二个接收器,它应该将消息发送到服务总线队列而不是Azure表。 启动SampleApplication和EventSourceSimulator时,前两个消息似乎正确传递,但第三个消息显示404错误。 以下是错误和我的接收器类的屏幕截图。如果您需要更多信息来帮助我,请告诉我。 提前谢谢,

Austin 404 Error

public class ServiceBusQueueSink<TEvent>
{
    readonly QueueClient _queueClient;
    readonly NamespaceManager _namespaceManager;
    readonly string _connectionString;
    readonly string _queueName = "DeviceErrorsQueue";
    readonly string _errorType;
    readonly bool _storeCtis;

    ServiceBusQueueSink(string errorType, bool storeCtis)
    {
        _errorType = errorType;
        _storeCtis = storeCtis;

        // Configure Queue Settings
        QueueDescription qd = new QueueDescription(_queueName);
        qd.MaxSizeInMegabytes = 2048;
        qd.DefaultMessageTimeToLive = new TimeSpan(0, 1, 0);

        // Create the queue if it does not exist already
        _connectionstring =  CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");

        _namespaceManager = NamespaceManager.CreateFromConnectionString(_connectionString);

        if (!_namespaceManager.QueueExists(_queueName))
        {
            _namespaceManager.CreateQueue(_queueName);
        }

        _queueClient = QueueClient.CreateFromConnectionString(_connectionString, "DeviceErrorsQueue");

    }

    /// <summary>
    /// Write each received event into the service bus queue.
    /// </summary>
    /// <param name="e">Event to write.</param>
    public void OnNext(PointEvent<TEvent> e)
    {
        bool send = false;
        if (e.EventKind == EventKind.Cti)
        {
            if (_storeCtis)
                send = true;
            else
                send = false;
        }
        else
            send = true;

        if (send)
        {
            BrokeredMessage message = new BrokeredMessage(e);
            message.Properties["ErrorType"] = _errorType;
            _queueClient.Send(message);
        }
    }

    /// <summary>
    /// Static method that returns a new Service Bus Queue sink observer.
    /// </summary>
    /// <param name="storageConnection">Service Bus Queue connection string.</param>
    /// <param name="errorType">Type of error to be saved in properties of brokeredmessage.</param>
    /// <param name="storeCtis">Flag specifying whether to also persist CTI events.</param>
    /// <returns></returns>
    public static IObserver<PointEvent<TEvent>> CreateObserver(string errorType, bool storeCtis)
    {
        var res = new ServiceBusQueueSink<TEvent>(errorType, storeCtis);
        return Observer.Create<PointEvent<TEvent>>(e => res.OnNext(e));
    }

更新:我在管理门户网站的服务总线队列中看不到任何内容,所以我想没有任何东西可以实现。

2 个答案:

答案 0 :(得分:1)

我想你在(yourservice)/设备上有一个HttpSource,对吗? 问题是,在收到两条消息后,查询中的某些内容中断了,我怀疑输出会下沉。因此,您在此地址收到404,因为整个查询已关闭。请查看StreamInsight存储帐户中的日志表,您应该在那里看到错误/异常信息。

答案 1 :(得分:0)

您似乎找到了问题的原因。通常,如果HTTP端点返回404(可能在几次成功请求之后),则查询管道中的某些内容可能会爆炸,如上面的第一个回复所示。在这种情况下,您可以通过连接调试器并检查查询的诊断来获得抛出的异常。 Austin CTP软件包附带的FAQ(入门文档的一部分)提供了有关该软件包的更多信息。

相关问题