Single adapter to emit multiple event types RRS feed

  • Question

  • I need to create an input adapter that will process a single data stream sent from a remote server and, based on what it sees, will periodially generate events of 2 similar but distinct types.

    What is the best approach for that situation?

    Can I create a separate stream for each event type? Or should I create a single event type that 'unions' the fields and has a flag to indicate which type's data is loaded in a given instance?

    Querying will involve both types.


    Tuesday, October 27, 2009 3:45 PM


  • Al,
    One specific adapter implementation can only produce one event type (might or might now be known at adapter development time - typed vs. untyped). You are better off to implement multiple adapters. If they are not typed, you can use a single factory, which will instantiate the appropriate adapter at runtime - you decide what to do in the Create() method. This way, the adapters can share resources or a base implementation through the factory. Otherwise, with typed adapters, you have to ue separate factories for each, since the type is in the signature of the Create() method of a ITypedInputAdapterFactory.
    It depends on your query whether it makes more sense to design a single event type that unifies both stream schemas.
    MS StreamInsight Team

    Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, November 3, 2009 8:33 PM