Showing posts with label StreamInsight. Show all posts
Showing posts with label StreamInsight. Show all posts

Wednesday, August 4, 2010

StreamInsight OutputAdapter_Cleanse or xxx_Cleanse has no events.

Given a very basic LINQ Query, I wrote a helloworld sreaminsight application.  basically I’d like to generate some raw data in the inputPointAdapter, and dump out the data by filtering to outputadapter.

var output = from p in stocks
where p.Price > 30
select p;

when I run the application and turn on the event flow debugger, I get the following dilemma. Events are generated and push to the CEP engine, but the OutputAdpater get no events. specifically, the OutputAdapter_Cleanse has no events.

image

the other two operations get no result.
image

Why?

the short answer is CTI(Current Time Increment)
  CTI behaves like a Commit flag in SQL Server, Which tells the system It’s safe to process those data I marked . without CTI, all the data are waiting to be committed then it will be able to picked up by the OutputAdapter.

How to Inject the CTI in your adapter. either by Configuration or Enque the CTI events by yourself.
  Here is one code snippet to tell the the Adapter to inject CTI Every time it get 10 events.


AdvanceTimeGenerationSettings gs = new AdvanceTimeGenerationSettings(10, TimeSpan.FromTicks(-1), true);
AdvanceTimeSettings ats = new AdvanceTimeSettings(gs, null, AdvanceTimePolicy.Adjust);
qb.BindProducer<Stock>("stockinput", input, config, EventShape.Point);

Or eject in your InputAdapter


this.EnqueueCtiEvent(DateTime.Now);

Then you fixed the problem

image

Hope it helps:)

Monday, August 2, 2010

SQlServer StreamInsight , Unable to Create Application Microsoft.ComplexEventProcessing.ConnectionException: Access is denied

StreamInside is the Microsoft version of CEP (Complex Event Processing) solution. Even it’s called Server server 2008 R2 StreamInside, It has nothing to do with the SQLServer 2008 R2. but in term of licensing. So you don’t need to install SQl server 2008 r2 in order to run the CEP.

after finished installing the StreamInside and setup one instance called StreamInside. time to write a hello world application.

System.ServiceModel.WSHttpBinding binding = new System.ServiceModel.WSHttpBinding(System.ServiceModel.SecurityMode.Message);
System.ServiceModel.EndpointAddress ea=new System.ServiceModel.EndpointAddress("http://localhost/StreamInsight/StreamInsght");

using (Server server = Server.Connect(ea,binding  ))
{

try
{
// Create application in the server. The application will serve
// as a container for actual CEP objects and queries.
Console.WriteLine("Creating CEP Application");
Application application = server.CreateApplication("TrafficJoinSample");

Then click and run, get the following error, access is denied.

c2

How comes ? then I run a cordbg and attach to the Host Server. Get the error stack trace.  It requires the user to be the Group of StreamInsightUser$[instanceName]
  image
 

Can I override to just remove the security enforcement. the short answer is No. It hardcoded the roles Check.
image

image

what’s the principalpermission?

image

image

even you override the .config and change the binding security mode to None. it still need this role check.

 

What' you have to do is make sure you are in the named group. It looks for me that I have to restart the PC to get refreshed on the group ownership.

you can use the following C# code to query all the groups you have.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Security.Principal;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {

            System.Security.Principal.WindowsIdentity.GetCurrent().Groups.ToList().ForEach

                (e => Console.WriteLine(((System.Security.Principal.NTAccount)e.Translate(typeof(System.Security.Principal.NTAccount)))));

        }
    }
}

More troubleshooting entries.

 
Locations of visitors to this page