It’s been 2 months since the latest version of the Warden has been released as the NuGet packages. Although our focus (yes, I’m not the only one person anymore working on this project) has moved towards the development of so-called stack (brand new API, Website, Microservices etc.) I’m still actively developing the core library in order to make it even more useful than before.
The Warden Manager is the latest feature that allows to control the instance of the IWarden. What does it mean in practice? By using the Manager, you are able to “pack” (or “box”) the existing instance of the IWarden and provide a so-called CommandSource (along with the EventHandler, yet it’s not required) in order to be able to control the Warden process for example via an external application. You can send the commands like PauseWarden, PingWarden or even KillWarden using the service bus or any other mechanism that you prefer. These commands will be immediately processed and they will also return an event that you can hook up into if you need a sort of acknowledgment response.
There are 2 new sample applications under the Examples directory in the repository using the Rebus. In order to run them, make sure you’ve enabled the MSMQ and run the Warden.Examples.CommandsAndEvents.Manager application first in order to create a queue that will be used by the Warden.Examples.CommandsAndEvents.App.
var wardenManager = WardenManager.Create(warden, cfg =>
cfg.SetCommandSource(() => CommandSource)
.SetEventHandler(() => EventHandler);
Logging messages (hooks invocation, watcher checks, errors etc.) is another feature available in the latest release of the Warden. You can use the logging e.g. either for debugging or informational purposes. There are 4 logging levels: Error, Info, Trace and All and a built in console logger (yes, it even does have a neat colors) that you can integrate with a single line of code:
WithConsoleLogger(minLevel: WardenLoggerLevel.Info, useColors: true);
You can also create your own logger, just implement the IWardenLogger interface and make use of the SetLogger() function.
Thanks to the contribution from the samjudson the Process Watcher now allows to provide an optional parameter for specifying the remote server address.
The Cachet integration has been also fixed thanks to the feedback from the janpieterz – the watchers can be grouped now, and there’s no more “spamming” about the valid check results if not specified explicitly. There’s also an ongoing discussion about refactoring the already existing MSSQL Watcher into something more generic that would also work with the other databases such as Oracle or MySQL. And since we’re working on the new API, I’ve managed to extend the HTTP API Integration with the new methods that will allow for the seamless integration.
The core Warden repository remains under the active development and all of the pull requests, as well as the feedback reported as issues is greatly appreciated. On the other hand, we’ve integrated the API with auth0 for the users authentication, SignalR and a very cool RethinkDB that I’ve found out quite recently. There’s also a very new Services repository, as I’m already thinking in terms of scalability using the service bus and microservices hype.
The Web project contains more than a single page and is built on top of the Aurelia framework. And all of that works with the Spawn project (thanks to the service bus), so hopefully by the end of this year, there will be the first real MVP with a totally new UI and at least a part of the cool features that we have in mind.
By the way – you can see me talking about the Warden tomorrow (20th of September) in the Wrocław .NET developers group – click here for the deatils of the meetup.