static void ServerConfig(MicroservicePersistenceWrapper <Guid, MondayMorningBlues> wrapper) { PersistenceClient <Guid, MondayMorningBlues> persistence = null; //if ((sContext.RedisCache & RedisCacheMode.Server) > 0) //{ // cacheManager = RedisCacheHelper.Default<Guid, MondayMorningBlues>(e.Config.RedisCacheConnection()); //} wrapper.Pipeline .AddDebugMemoryDataCollector((c) => wrapper.Collector = c) .AddChannelIncoming("internalIn", boundaryLoggingEnabled: true) .CallOut(PersistenceCommandSet) //.AttachResourceProfile(new ResourceProfile("TrackIt")) //.AttachAzureServiceBusQueueListener("Myqueue") //.AttachCommand(new PersistenceBlahMemory()) .AttachPersistenceClient(out persistence) .Revert() .AddChannelOutgoing("internalOut", internalOnly: true) ////.AppendBoundaryLogger(bLogger) //.CallOut((c) => cpipeOut = c) .Revert(); wrapper.Persistence = persistence; }
static void ServerInit(MicroservicePersistenceWrapper <Guid, MondayMorningBlues> wrapper) { wrapper.Pipeline //.ConfigurationClear() .ConfigurationSetFromConsoleArgs(sSettings.Switches) //.Condition((c) => c.AesTransportEncryptionUseCompression ; }
static void ClientConfig(MicroservicePersistenceWrapper <Guid, MondayMorningBlues> wrapper) { PersistenceClient <Guid, MondayMorningBlues> persistence = null; wrapper.Pipeline .ConfigurationSetFromConsoleArgs(sContext.Switches) .AddDebugMemoryDataCollector((c) => wrapper.Collector = c) .AddChannelIncoming("internalOut") .AttachPersistenceClient(out persistence, "internalIn") .Revert() .AddChannelOutgoing("internalIn", internalOnly: true) .Revert(); }
static void Main(string[] args) { sContext = new ConsoleContext(args); sClient = new MicroservicePersistenceWrapper <Guid, MondayMorningBlues>("TestClient", ClientConfig); sServer = new MicroservicePersistenceWrapper <Guid, MondayMorningBlues>("TestServer", ServerConfig, ServerInit); sApiServer = new ApiWrapper <Guid, MondayMorningBlues>(); sClient.StatusChanged += StatusChanged; sServer.StatusChanged += StatusChanged; sApiServer.StatusChanged += StatusChanged; sMenuMain.Value.Show(args, shortcut: sContext.Shortcut); sClient.StatusChanged -= StatusChanged; sServer.StatusChanged -= StatusChanged; sApiServer.StatusChanged -= StatusChanged; }
static void Main(string[] args) { //The context holds the active data for the console application. sSettings = new ConsoleSettings(args); sClient = new MicroservicePersistenceWrapper <Guid, MondayMorningBlues>("TestClient", sSettings, ClientConfig); sServer = new MicroservicePersistenceWrapper <Guid, MondayMorningBlues>("TestServer", sSettings, ServerConfig, ServerInit); sApiServer = new ApiPersistenceConnector <Guid, MondayMorningBlues>(ApiConfig); //Attach the client events. sClient.StatusChanged += StatusChanged; sServer.StatusChanged += StatusChanged; sApiServer.StatusChanged += StatusChanged; //Show the main console menu. sMenuMain.Value.Show(args, shortcut: sSettings.Shortcut); //Detach the client events to allow the application to close. sClient.StatusChanged -= StatusChanged; sServer.StatusChanged -= StatusChanged; sApiServer.StatusChanged -= StatusChanged; }
static void ServerInit(MicroservicePersistenceWrapper <Guid, MondayMorningBlues> wrapper) { wrapper.Pipeline //.ConfigurationClear() .ConfigurationSetFromConsoleArgs(sContext.Switches); }