none
StreamInsight Service on Windows doesn't recognize the application dlls

    Question

  • I have my project worked fine with embbed stream insight instance. But when I tried to use the standardalone StreamInsight service on Windows, I got an exception when this code is run

    using (matchQuery.Bind(sink).Run())

    An exception of type 'Microsoft.ComplexEventProcessing.ConnectionException' occurred in Microsoft.ComplexEventProcessing.Diagnostics.dll

    It said that The management service encountered an error: Could not load file or assembly 'MyApplication, Version=1.0.5198.16312, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    My question

    1. Why doesn't StreamInsight recognize the dlls?

    2. Do I need to installing the application dlls to GAC?

    I'm using StreamInsight 2.1

    My system is 64 bit.

    My project is configurated with any CPU.

    • Edited by camping89 Wednesday, March 26, 2014 5:05 AM
    Wednesday, March 26, 2014 2:20 AM

All replies

  • There are two possible solutions:

    1) You can install the application DLLs in the GAC. That'll work.

    2) Copy the application DLLs to the StreamInsight instance folder -or- the StreamInsight \bin folder. Of the two, I'd use the instance folder because that'll give you isolation if you have multiple instances running on the same machine. The instance folder will be under the StreamInsight install folder\Host\[InstanceName]. Note: You'll also find the app.config for your StreamInsight instance there. I wouldn't modify it but it can be interesting to take a peek at.

    Of the two, I tend to use method #2 but that's (mainly) personal preference.


    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.

    Wednesday, March 26, 2014 3:04 PM
    Moderator
  • I check my assembly information and found that it is set to  dynamic version: 1.0.*.*.

    Each time I run the application, the StreamInsight requires different version of dll.

    I changed the version to fixed number: 1.0.0.0. And that error didn't happened anymore.

    However, I got another issue that the binding didn't process the result from standing query

    This is my StreamInsight code, I'm using IQStreamable as source and sink as output adapter.

    public static void Main(string[] args)
            {
                // The StreamInsight engine is a server that can be embedded (in-memory) or remote (e.g. the Azure Service).
                // We first use Server.Create to create a server instance and return a handle to that instance.
                using (Server server = Server.Connect(new EndpointAddress(@"http://localhost/StreamInsight/Default")))
                //using (Server server = Server.Create("Default")) // I just need to turn this line on and it worked.
                {
                    Application application = server.Applications.ContainsKey("app")
                                                ? server.Applications["app"]
                                                : server.CreateApplication("app");

                    // We will be building a query that takes a stream of SensorReading events. 
                    // It will work the same way on real-time data or past recorded events.
                    IQStreamable<SensorReading> inputStream = null;

                    Console.WriteLine("Press L for Live or H for Historic Data");
                    ConsoleKeyInfo key = Console.ReadKey();
                    Console.WriteLine();

                    if (key.Key == ConsoleKey.L)
                    {
                        inputStream = CreateStream(application, true);
                    }
                    else if (key.Key == ConsoleKey.H)
                    {
                        inputStream = CreateStream(application, false);
                    }
                    else
                    {
                        Console.WriteLine("invalid key");
                        return;
                    }

                    // The query is detecting when a threshold is crossed upwards.
                    // See the Visio drawing TresholdCrossedUpward.vsd for the intuition.
                    int threshold = 42;

                    // Alter all events 1 sec in the future.
                    var alteredForward = inputStream.AlterEventStartTime(s => s.StartTime.AddSeconds(1));

                    // Compare each event that occurs at input with the previous event.
                    // Note that, this one works for strictly ordered, strictly (e.g 1 sec) regular streams.
                    var crossedThreshold = from evt in inputStream
                                           from prev in alteredForward
                                           where prev.Value < threshold && evt.Value > threshold
                                           select new Result()
                                           {
                                               Time = evt.Time,
                                               Low = prev.Value,
                                               High = evt.Value
                                           };

                    var sink = application.DefineObserver(() => Observer.Create<Result>(result => Console.WriteLine(result.Time+ " " + result.Low + " " + result.High)));

                    //foreach (var outputSample in crossedThreshold.ToEnumerable())
                    //{
                    //    Console.WriteLine(outputSample);
                    //}
                    using (crossedThreshold.Bind(sink).Run())
                    {
                        Console.WriteLine("Done. Press ENTER to terminate");
                        Console.ReadLine();
                    }
                }
            }


    The code is really simple, I modified it from Microsoft StreamInsight v2.1 Example, HelloWorld application.

    Notice this line:

    var sink = application.DefineObserver(() => Observer.Create<Result>(result => Console.WriteLine(result.Time+ " " + result.Low + " " + result.High)));

    // If will print the result to the console, however, when I use service server code, I got nothing.

    using (Server server = Server.Connect(new EndpointAddress(@"http://localhost/StreamInsight/Default")))
    //using (Server server = Server.Create("Default")) // I just need to turn this line on and it worked.

    Something is missed with the code for service server, because if I just switch to the embbed code, it worked.

    But I dont know what am I missing.

    I checked the event log and no error is there, which means everything should work fine, but it didn't.

    I'm using StreamInsight 32bit, my machine is 64 bit. I copied the HelloWorld dll to the intance folder at <installed folder>\Host\MSSI.<InstanceName> (my name: MSSI.Default).

    Do you have any idea for this?

    Regards,

    Vu








    • Edited by camping89 Thursday, March 27, 2014 7:31 AM
    Thursday, March 27, 2014 3:45 AM
  • Are you running this from the debugger? Is it a fresh build every time?

    My thought, right now, is that you have a version mismatch between the client and the server. Keep in mind that, when using Server.Connect, you are making WCF Web Services calls to the StreamInsight server and everything is getting serialized on the wire. Server-side, it needs to be deserialized and if the versions don't match, it won't deserialize properly.

    A couple of things that you could do:

    1) Have a AfterBuild command that stops the streaminsight service and copies the newly built dlls to the StreamInsight folder

    2) Specify assembly binding redirection for your assemblies in the StreamInsight instance config file.


    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.

    Friday, March 28, 2014 2:10 PM
    Moderator
  • Thanks for the suggestion. I never use the after build command before.

    However I realized that the StreamInsight service has its own memory space, and the console write line method will write on the service console. So I can not see the result.

    So I have a concern:

    What if I need StreamInsight windows service know about my application memory space? What should I do?

    For more specific, let say I have a list on the ApplicationClass, then in ApplicationClass I call the method OnNextMatch which will accept a standing query result. Then, OnNextMatch (will be executed on windows service) will refer to the list in ApplicationClass memory, and do the CRUD, and then update that list again.

    Do I have any way or work around to do this?

    Monday, March 31, 2014 9:07 AM
  • Yes, the StreamInsight service has its own memory space. It's a completely separate process and may not even be on the same physical machine.

    The only way to do what you are referencing is to have the functionality of the application class running in the process space of the server. Not knowing the architecture of how you are doing this makes it difficult to make a suggestion but there are several ways that it can be done. For example, if the application class is a static class in the assembly with the source/sinks assembly that is deployed to the remote server, you can call any initialization when the source or sink are first instantiated and load your list. You do need to be careful, however, whenever doing something like this as StreamInsight in inherently highly multi-threaded ... anything you do needs to be thread safe and that can be tricky and a little difficult to debug.


    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, March 31, 2014 11:22 AM
    Moderator
  • Hey J, again, thank you very much for your help.

    Here is more information. 

    1. Application.Add(some objects) and save records to database.
    2. Transfer the result object of (1) to StreamInsight implementation class. (e.g. a static ConcurrentDictionary)
    3. Call to StreamInsight
    4. StreamInsight code get the object from ConcurrentDictionary, process the object, assign back to Application, do some CRUD operations and save the object and associated objects again to database.
    5. Log the result/exception to file.

    This way, the StreamInsight service need to know about the ConcurrentDictionary of Application, and have to do change the Application.ConcurrentDictionary 

    In last stage, I use the embebbed StreamInsight server, so the Application and the StreamInsight server/application is in same memory space. So no problem so far.

    But I got a weird issue of embbed StreamInsight: the query/binding stop after around 6 minutes run.

    I don't know why, everything works fine, the database is updated as usual. But after 6 minutes, I get the message said that  the query/binding stop stopped (from event viewer).

    If you have any suggestion and deal with the embbed StreamInsight death before, please let me know your idea.

    Tuesday, April 01, 2014 9:58 AM
  • I'm really thinking that you are far better off going with the embedded server. There's nothing that the service does that you can't do in your own process. And it'll totally simplify your solution. Creating a Windows Service to host your StreamInsight instance in pretty straightforward in C#.

    Architecturally, I'm not sure your implementation is the best way to go about what you are trying to do. But I don't know enough about your use case to say one way or another. I'd need to know where the data is coming from - originally, before you process it and add to the application dictionary - and what you're trying to get out of StreamInsight.

    Now ... for the StreamInsight "death" ... yeah ... I've had that happen. You need to figure out why the binding stopped and that can be a challenge. First ... the best case: is your source calling OnCompleted? That will stop your binding. After all, you're telling it that you're completed. Second case: there's an exception in either your query or in a user-defined extension (UDA/UDO/UDF) somewhere in your query. If you aren't calling OnCompleted, this is most likely what's happening. You may be able to get some clues as to what's going on from the event flow debugger ... it may tell you why the query stopped when you look at the query/process in the EFD. The other thing that you can do is to let it run while in Visual Studio with Intellitrace turned on. Intellitrace will pick up any exceptions thrown and give you some pretty good details on what's going wrong. In fact, I've found Intellitrace to be absolutely essential in figuring these things out.


    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, April 01, 2014 11:18 AM
    Moderator
  • Architecturally, I'm not sure your implementation is the best way to go about what you
     are trying to do. But I don't know enough about your use case to say one way or another. I'd need to know
    where the data is coming from - originally, before you process it and add to the application dictionary -
    
    and what you're trying to get out of StreamInsight.

    1. Data is from user input.

    2. Processed data will be done by StreamInsight (in OnNext of IObserver of the SINK) and saved to database. The data won't be returned back, but it need to read other associated data from application memory while processing.

    Let's say it a simpler way like this, but it's actually simple, I think

    1. User input data into form

    2.1. Data is saved to database in Application.Add()

    2.2. Same data is transfer to StreamInsight code and is appended to a queue (ConcurrentDictionary).

    3. StreamInsight code call the StreamInsight Service, the input stream of standing query is combined from the data and another stream (e.g. IQFeed for financial/stock/equity data)

    4. using(matchQuery.Bind(sink).Run()) is called. The sink is defined with an observer that accept the result of standing query.

    e.g. OnNext(myObject){

        // use myObject to do some business rules

       // The code here use and update the data in Application.ConcurrentDictionary

       // Then it will update myObject to database with new properties.

    }

    I will try again with your suggestion about the "death". But my concern is: if everything is fine, the embbed server instance as well as binding, query, etc should keep alive, right?

    Thanks,




    • Edited by camping89 Wednesday, April 02, 2014 1:38 AM
    Wednesday, April 02, 2014 1:22 AM
  • OK ... rather than adding the user input to a database and then reading it back out into StreamInsight, why don't you expose a WCF Web Service source for the user input and use that? The app that's collecting the user input can still put it into the database if you need it for other things but StreamInsight doesn't need to be aware of this at all. No need for the concurrent dictionary at all and it's streamlined.

    The "associated data" from application memory sounds like reference data ... there's no reason that can't be done as a part of your query. Again, this will wind up simplifying your solution as your reference data is now handled in your query rather than as something separate and outside of the engine.

    And yes, if everything is fine, you don't call OnCompleted on the Observer in your source and there are no exceptions, the query will continue running until you stop it.


    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.

    Wednesday, April 02, 2014 12:20 PM
    Moderator
  • Oh, in fact, the user input data through a WCF service. And that data at a moment is one object, let's call it "Order".

    User input order, and the submitted order is add to a queue in "TradeService". There is a list of orders that is waiting for process.

    So I need to pass this order list to StreamInsight service. What would be the steps to do this? Because at the time StreamInsight init, the orders are just for that moment, and there are more and more orders are coming.

    Later, if one order is finished processing, that order will be saved to DB in OnNext of Observer. And that orderId should be removed from Application's orders (I have to reference to Application's orders and remove the orderId from it, but at this time, StreamInsight process doesn't know about the Application's order).

    Thursday, April 03, 2014 1:04 AM
  • What is it that StreamInsight is doing? Are you expecting to start the query, get a result and stop the query for each order?

    What is the StreamInsight service doing? And why do you need the queue of orders? I have a sneaking feeling that you're thinking about this in non-"StreamInsight thinking" and making it more difficult than it should be. I typically wouldn't use a shared Application object either - I'm a little confused about that.

    As for a WCF Web Service, download my presentation from HDNUG. Part of that demo is a WCF Web Service that is a source for the queries.


    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.

    Thursday, April 03, 2014 1:18 AM
    Moderator
  • This is the code of my StreamInsight class, method Run(). It is called for first order. Second order and other orders are added to the Orders list (queue) and wait for processing after first order is done.

    using (Server server = Server.Create(StreamInsightInstanceName)) // using embbed server { string applicationName = StreamInsightInstanceName; Application application = server.Applications.ContainsKey(applicationName) ? server.Applications[applicationName] : server.CreateApplication(applicationName); var orderGenerator = new OrderGenerator(); // orderGenerator generate a IEnumerable<Order> and use this as input source. IQStreamable<Quote> orderStreamable = GetQuoteStreamable(application, orderGenerator); var matchQuery = (from generatedOrder in orderStreamable.ToObservable() from order in Orders.Where((_ => _.Symbol == symbol )) // this is order list select new MatchPairs // a DTO class with 2 properties of type Order { GeneratedOrder = generatedOrder, Order = order }); var sink = application.DefineObserver(() => new FinancialLogic()); // Everything related to business rules will be do in this FinanciaLogic class.

    // FinancialLogic is inherited from IObserver<MatchPairs>

    // FinancialLogic.OnNext() will do some business logics and then if 2 orders are matched with each other.

    // The order will be removed from Orders. using (matchQuery.Bind(sink).Run()) { while (Orders.Any(_ => _.Symbol == symbol)) { // keep matching while this symbol still has orders. } } }

    So, if I change the code to use the StreamInsight service, in FinancialLogic class, it wont know about the Orders.

    When FinancialLogic class try to remove the matched order from Orders, it said that Orders is null.

    This didn't happened with embbed server.

    May be my thinking already went out of the "StreamInsight thinking". But I don't know what am I wrong for the thinking now.

    Please let me know your idea about this.

    I'm new to StreamInsight and current version is 2.1. I have heard about the CEPStream, InputAdapter, and OutPutAdapter class. But I still feel confused about that. What I'm using here is a IQStreamable as input source and sink with an IObserver. So what are the differences? And which kind should I use in this scenario?

    Thanks for your helps.

    Friday, April 04, 2014 1:39 AM
  • OK ... First things first. With StreamInsight 2.1, a new model for queries, data sources and data consumers was introduced that's based on Reactive, IObservable and IObserver. That's what you are using. The "legacy" API that was introduced when StreamInsight was first released uses Adapters and CepStreams. Functionally, you can do the same things but the new model has several advantages. First, it's easier to create sources and sinks based on the Rx model than it was in the old model. While that's still the trickiest part of any StreamInsight solution, it's far simpler to manage the lifetime of the data sources and consumers in Rx than it was in the adapter model. Second, the "Hydra" model for queries/processes allows StreamInsight to more efficiently and elegantly manage multiple output targets from a single input stream or set of input streams. The legacy model used Dynamic Query Composition - DQC - which was, internally, a matched input/output adapter so you'd have multiple queries running that were one logical process but had to be managed independently; there was no higher-order structure for a set of related queries that started and stopped as a single unit. In the Rx model, we now have that with processes (which is a bad name ... QuerySet or StreamProcess might have been better). Finally, the Rx model also allows you to use Subjects to have sources and consumers attach/detach at runtime. The legacy adapter model had nothing like this baked in so you had some use cases that were very difficult to near impossible as well as other use cases that were highly dependent on startup order.

    In short, you're fine with the model that you are using and, in many ways, it's better. The biggest downside to the Rx model is that it is trickier to import CTIs from a fast-moving stream into a slower-moving (e.g. reference) stream. But it's not impossible and, even so, there's an additional level of flexibility in those scenarios that you don't have with the legacy model.

    Now ... to your sample. It does look like you are thinking of StreamInsight as a batch-processing engine. While that's a common way for folks to look at it and try to use it, it's not. Your Orders list shouldn't be a queue ... it should be a stream. Order processing will occur according to the CTIs and in the order that they come in. I'd also look to see how much of your FinancialLogic can be done as a query rather than as an Observer. Once your orders are a stream, rather than a queue, you won't need to call ToObservable on the quotes stream - this gets the processing out of the StreamInsight engine and into Reactive. You lose all of your temporal headers doing this and it's less efficient. And since you'll need the last known value for the quote - at all times - you'll want to use the ToSignal pattern [orderStreamable.AlterEventDuration(e => TimeSpan.MaxValue).Clip(orderStreamable, (e1, e2) => e1.Symbol == e2.Symbol)] to ensure that the last quote that came in before the order is available for matching. This also opens up things for some additional functionality. Say, for example, that the order has an expiration and min and/or max. So the order is enqueued as an IntervalEvent with a start and end time. If the order matches the last known quote, it generates a result for the output. If not, it stays "valid" in the stream until its expiration and, if a quote comes in that matches the criteria, it then gets processed and generates a result for the output. Make sense?
    And have you looked at the sample from my HDNUG presentation? The queries in there aren't a really good fit for everything that you are doing here but it should give you some ideas.


    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, April 05, 2014 2:11 PM
    Moderator
  • Here's a quick LinqPad sample -- if you don't have LinqPad, get it.

    In this example, the "rules" are simple. First, an "order to buy" is valid for 5 minutes. If there is a quote for the same ticker in that 5 minute period that is less than or equal to the "buy" order, the order matches and is output. Otherwise, the order event expires and "disappears" from the stream.

    void Main()
    {
    	Func<int, DateTimeOffset> t = (m) => new DateTimeOffset(2011, 1, 11, 8, 0, 0, TimeSpan.Zero).AddMinutes(m);
    	
    	var quotes = Application.DefineEnumerable(() => new[]{
    		new {Timestamp = t(0), Symbol="MSFT", Quote=39.85},
    		new {Timestamp = t(0), Symbol="NOV", Quote=78.93},
    		new {Timestamp = t(1), Symbol="MSFT", Quote=39.87},
    		new {Timestamp = t(3), Symbol="NOV", Quote=78.91},
    		new {Timestamp = t(3), Symbol="MSFT", Quote=39.88},
    		new {Timestamp = t(4), Symbol="MSFT", Quote=39.89},
    		new {Timestamp = t(4), Symbol="NOV", Quote=78.88},
    		new {Timestamp = t(5), Symbol="NOV", Quote=78.89},
    		new {Timestamp = t(6), Symbol="NOV", Quote=78.93},
    		new {Timestamp = t(7), Symbol="MSFT", Quote=39.87},
    		new {Timestamp = t(8), Symbol="MSFT", Quote=39.85},
    		new {Timestamp = t(8), Symbol="NOV", Quote=78.92},
    		new {Timestamp = t(9), Symbol="NOV", Quote=78.90}
    	});
    	
    	var orders = Application.DefineEnumerable(() => new[]{
    		//This will match immediately. 
    		new{Timestamp = t(0), Symbol="MSFT", Price=39.86},
    		//This will match later. 
    		new{Timestamp = t(1), Symbol="NOV", Price=78.88},
    		//This will never match; even though there is a lower 
    		//quote in the stream, it's "clipped out" by a more 
    		//recent quote that comes before this order is placed.
    		//The match at timestamp(8) is *after* this order expires
    		new{Timestamp=t(2),Symbol="MSFT", Price=39.86}
    	});
    	//Create the quote stream. This is a point event. 
    	var quoteStream = quotes.ToPointStreamable(e => PointEvent.CreateInsert(e.Timestamp, 
    		new{Quote = e.Quote, Symbol = e.Symbol}), AdvanceTimeSettings.IncreasingStartTime);
    	
    	//Create an interval stream. In our case, we'll assume that an order is valid
    	//for five minutes.
    	var ordersStream = orders.ToIntervalStreamable(e => IntervalEvent.CreateInsert(
    		e.Timestamp, e.Timestamp.AddMinutes(5), new{Symbol = e.Symbol, Price= e.Price}), 
    		AdvanceTimeSettings.IncreasingStartTime);
    		
    	//ToSignal pattern - this will have the last valid quote available
    	//in the stream for analysis against orders. 
    	var quoteSignal = quoteStream.AlterEventDuration(e=> TimeSpan.MaxValue)
    					.ClipEventDuration(quoteStream, (e1, e2) => e1.Symbol == e2.Symbol); 
    		
    	//match orders that have a quote less than or equal to the order. 
    	//Our "rules" say that this order should be processed as a "buy"
    	var matchedOrders = from q in quoteSignal 
    						from o in ordersStream
    						where q.Symbol == o.Symbol 
    						where q.Quote <= o.Price
    						select new {
    							Symbol = q.Symbol, 
    							OrderPrice = o.Price, 
    							Quote = q.Quote
    						};
    						
    	
    	matchedOrders.ToPointEnumerable().Dump(); 
    	
    }
    


    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, April 05, 2014 8:57 PM
    Moderator
  • That's a lot of information and I need time to look at that and think.

    I will keep digging deeper and deeper, and I will follow up here.

    Thanks a lot for your help.

    Monday, April 07, 2014 9:59 AM
  • How are things going? It's been a while ...

    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.

    Sunday, May 04, 2014 5:15 PM
    Moderator
  • Hi,

    I followed your examples and your explaination and I used option 2

    "2) Copy the application DLLs to the StreamInsight instance folder -or- the StreamInsight \bin folder. Of the two, I'd use the instance folder because that'll give you isolation if you have multiple instances running on the same machine. The instance folder will be under the StreamInsight install folder\Host\[InstanceName]. Note: You'll also find the app.config for your StreamInsight instance there. I wouldn't modify it but it can be interesting to take a peek at."

    However I still face the problem "Could not load file or assembly"

    when I created a server.exe executable then I execute it

    After that I copied the client executable and dlls to myServer/Bin/Debug folder

    then I run client.exe which connect to the server created by server.exe

    I got this error

    Microsoft.ComplexEventProcessing.ConnectionException was unhandled

      HResult=-

    2146233088

      Message=

    Themanagementservice encountered an error: Could notloadfileorassembly 'MyClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'oroneofits dependencies. Thesystemcannot find thefilespecified.

    Source=Microsoft.ComplexEventProcessing.Diagnostics

      StackTrace:

    atMicrosoft.ComplexEventProcessing.Diagnostics.Exceptions.Throw(Exceptionexception)

    atMicrosoft.ComplexEventProcessing.RemoteServerProxy.Create[T](XmlReader definition, Uri parentName, T input)

    atMicrosoft.ComplexEventProcessing.Server.CreateCepObject[T](CepObject obj, T input)

    atMicrosoft.ComplexEventProcessing.Application.Deploy(Expression definition, Stringname, Stringdescription)

    atMicrosoft.ComplexEventProcessing.Linq.ApplicationRemoteProvider.Microsoft.ComplexEventProcessing.Linq.IRemoteProvider.Deploy(Expression expression, Stringid)

    atMicrosoft.ComplexEventProcessing.Linq.RemoteProvider.Deploy[TPayload](IRemoteStreamableSink`1definition, Stringid)

    atMyClient.Start(Stringpointsource, Int32 acceptableFutureRange, Int32 consistencyDelay) inD:\MyClient\DelayVsStreamTimeRunner.cs:line 80

    atMyClient.Program.Main(String[] args) inD:\MyClient\Program.cs:line 52

    Note that when I stop server.exe then run it again while client.exe is avaiable in same bin folder of server, after that I run client.exe I dont face the problem.

    But I do not want to stop my production server everytime I want to deploy something new.

    Thus, what is the best deployment option for production environment where I can deploy new queries, sinks and processes that have new classes without interrupting the running services

    Cheers, Muhammad

    Saturday, May 24, 2014 5:39 PM
  • How, exactly, do you expect it to work when you deploy new assemblies? Once an assembly is loaded into the address space of the process, the source file is locked for writes and it can't be reloaded into memory. That's not a StreamInsight limitation, that's Windows. Running DLLs can't be replaced while the process is running. Before you counter by saying "ASP.NET does that", you need to understand that ASP.NET accomplishes that with a bit of smoke and mirrors using shadow folders and restarting the IIS Worker Process. You'd have to do the same ... which isn't what you are looking for.

    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, May 26, 2014 11:18 AM
    Moderator
  • Thank you very much Devbiker, I always when I search for something about streaminsight I put the keywords and Devbiker to reach to most practical solution..

    "How, exactly, do you expect it to work when you deploy new assemblies?"

    For example, I want to deploy a sink StreamableSink<NewType> that have NewType class.

    Your answer is what I am looking for actually, which means I have to devide the work into components that have least change expected. and I deploy each component in different SI Server Instance which is resulted from Server.Create. The queries that are common between the components I going to duplicate them which would have extra computation duplication.

    Cheers, Muhammad

    Monday, May 26, 2014 6:12 PM