Creating our base microservice class
Let's start by discussing the member variables that we are going to keep track of. Here they are:
Variables
Here are our variables:
/// <summary> The timer. </summary> private static Timer _timer = null; /// <summary> The log. </summary> readonly static ILog _log = LogManager.GetLogger(typeof(BaseMicroService<T>)); /// <summary> Identifier for the worker. </summary> private string _workerId; /// <summary> The lifetimescope. </summary> readonly ILifetimeScope _lifetimescope; /// <summary> The name. </summary> private static string _name; /// <summary> The host. </summary> private static HostControl _host; /// <summary> The type. </summary> private static T _type; /// <summary> The connection factory. </summary> /// <summary> The bus. </summary> private IBus _bus; private ICacheManager<object> _cache = null;
The first variable up to bat is...