none
streaminsight app for different event types.

    Question

  • Hi,

    I am new to stream insight and just started going through the SI concepts.

         I have an application that receives data/events from different sources. So the event type is different from each source.

    for example from source s1 i may receive a structure

    class s1Event

    {

    public int field1;

    public int field2;

    }

    and from source s2 i may receive

    class s2Event

    {

    public int field1;

    public int field3;

    public int field5;

    }

    here field1 is common to both events and i would like to query the input on this common field but the event type may not be known in advance.

    Is there a way to dynamicaly handle eventtypes at runtime.

    Any help or links will be appreciated.

    Thanks,

    smita.

    Tuesday, July 23, 2013 12:50 PM

All replies

  • First, you'd need to have separate source queries for each event source. Inheritance isn't supported in queries.
    In your adapter/source, you would need use reflection to populate the fields. Or you could have each payload support a specific interface that takes name/value pairs and populates the fields. Only the properties get passed into the query; your payloads aren't present in the engine - they are only used for determining the schema.
    In the "legacy" adapter model, you can also use untyped adapters; they enqueue events with name/value pairs. This isn't in the Reactive model introduced in 2.1; you would have to use another method.

    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    Tuesday, July 23, 2013 2:11 PM