Ejemplo n.º 1
0
        public ClientSystem(string userName)
        {
            this.container = new UnityContainer();
            var config = new EventStoreConfig(userName);

            SingleMicroserviceInitializer.Run(container: this.container, useSignalRLog: false,
                                              microserviceFactory: () =>
                                              MicroserviceFactory <ItemClient, ItemClientHandler>
                                              .CreateEventProcessorWithApp <ItemClientApp>(
                                                  uniqueName: $"{userName}",
                                                  appUniqueName: $"{userName}App",
                                                  container: this.container,
                                                  eventStoreConfig: config,
                                                  publisherFactory: (streamType, bus, log, dao, eventsToPushMaxCount, pollTimeout)
                                                  => new OcassionallyConnectedPublisher(streamType, bus, log, dao, eventsToPushMaxCount, pollTimeout, "v1",
                                                                                        "http://localhost:51343/client-proxy/upload", "123", "OccServer")));
        }
Ejemplo n.º 2
0
        /// <summary>Registers the type mappings with the Unity container.</summary>
        /// <param name="container">The unity container to configure.</param>
        /// <remarks>There is no need to register concrete types such as controllers or API controllers (unless you want to
        /// change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.</remarks>
        public static void RegisterTypes(IUnityContainer container)
        {
            var config = new EventStoreConfig();

            proxies.Add("OccClient1", new OcassionallyConnectedSource("OccClient1"));
            proxies.Add("OccClient2", new OcassionallyConnectedSource("OccClient2"));

            SingleMicroserviceInitializer.Run(
                container: container,
                useSignalRLog: true,
                ocassionallyConnectedSources: proxies.Values.ToList(),
                microserviceFactory: () =>
                MicroserviceFactory <ItemServer, ItemServerHandler>
                .CreateEventProcessor(
                    uniqueName: "OccServer",
                    container: container,
                    eventStoreConfig: config));
        }