none
input from WCF service with StreamInsight 1.2

    Question

  • Hi,

    Is there a sample (for StreamInsight 1.2) where they use a webservice or WCF service as input for the input adapter?

    Thanks,
    K

    Friday, June 14, 2013 4:14 PM

All replies

  • The StreamInsight sample adapters for V 2.0 (http://streaminsight.codeplex.com/releases/view/46435) have a WCF input adapter.

    There aren't any API differences between 1.2 and 2.0 so you can download this, change the references from 2.0 to 1.2 and run them.


    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.

    Saturday, June 15, 2013 1:51 PM
  • Thanks for the answer.
    I have checked the sample but I have a question...

    I want to produce the events in my web application where I have my WCF service.
    So when there is a call to my WCF service I want to create an event and send it through the CEP.
    Instead of creating events in the StreamInsight application like in the sample (ProduceEvents method).
    So I think I need to move the ProduceEvents method to the WCF service so that when I call my WCF service method I call the ProduceEvents method to create an event.

    Is that correctly or do I forget something?
    Because when I debug, it is as if he generate multiple events...
    Monday, June 17, 2013 1:07 PM
  • Let me see if I understand your application flow.

    You have an ASP.NET Web Application that hosts a web service. When there is a call to the web service, you want to create an event in StreamInsight and send it through.

    Question: is the web service for anything except to send things to StreamInsight? If it is, then you'll have a second Windows Service that hosts a WCF service for the events. If not - if your web service is only for client to send to StreamInsight, then you can host the WCF service directly from your own StreamInsight-based Windows service. Now ... you may want the additional layer for other reasons (isolation, security, etc.) but that's going to depend on your use cases and requirements.

    You do not want to host the StreamInsight process in an ASP.NET application. Period.


    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.

    Monday, June 17, 2013 7:09 PM
  • In fact this service is just to send the event to StreamInsight so indeed I can opt to host the WCF service in the StreamInsight application.

    So in that case it is the same like in the sample, the only difference is that I need an operation to call with my client when I want to create an event. Because in the sample it will generate the events directly... (new Thread(() => ProduceEvents(inputAddress)).Start();)

    So I can place this line in comment and just call an operation that enqueue the incoming event. Correct?

    Tuesday, June 18, 2013 8:06 AM
  • I changed the sample but there is no output at the method ConsumeEvents in my client.

    Tuesday, June 18, 2013 10:09 AM
  • First, I can't download your sample - I the host name doesn't resolve in DNS.

    Second, I'm looking at the sample and I don't see anywhere in the WCF Input Adapter sample adapter where it automatically enqueues events. Just take the Input Adapter sample adapter ... not the project hosting it ... and start with that. All you would do is make the calls that are in ProduceEvents() yourself.


    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, June 18, 2013 1:45 PM
  • Here you can find my solution

    In the solution I just added a console application that create events.
    Just the consuming of events are not working...

    Tuesday, June 18, 2013 2:00 PM
  • You aren't enqueuing any CTIs. Either enqueue some CTIs from your test client or set the AdvanceTimeSettings for the adapter.

    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, June 18, 2013 2:38 PM