0

What's the best practice for handling exceptions in StreamInsight 2.0?

When an exception occurs (I'm not talking about missing events but actual exceptions like NullReferenceException someware in the code) how do you handle it and safely bring the application to a stop considering that everything is executed asynchronously?

JohnDoDo
  • 4,720
  • 8
  • 31
  • 47

1 Answers1

0

How your application handles exceptions will depend on what your application is supposed to be doing. At a minimum, I would log the exceptions. If you are using the legacy adapter model, then exceptions in your query will cause the query to go into an "Aborted" state. If you are using the StreamInsight 2.1 Rx sources/sinks model, then you can handle exceptions using the IObservable.OnError method in your sink. Good testing and writing your code defensively will go a long way to making you more successful.

More Information about IObservable and IEnumerable Interfaces in StreamInsight

TXPower275
  • 511
  • 2
  • 9