Esempio n. 1
0
        /// <summary>
        /// Configure and create an in-memory bus
        /// </summary>
        /// <param name="baseAddress">Override the default base address</param>
        /// <param name="configure">The configuration callback to configure the bus</param>
        /// <returns></returns>
        public static IBusControl Create(Uri baseAddress, Action <IGrpcBusFactoryConfigurator> configure)
        {
            var topologyConfiguration = new GrpcTopologyConfiguration(MessageTopology);
            var busConfiguration      = new GrpcBusConfiguration(topologyConfiguration, baseAddress);

            var configurator = new GrpcBusFactoryConfigurator(busConfiguration);

            configure(configurator);

            return(configurator.Build(busConfiguration));
        }
Esempio n. 2
0
        protected override IBusControl CreateBus()
        {
            var configurator = new GrpcBusFactoryConfigurator(_busConfiguration);

            configurator.Host(BaseAddress, x =>
            {
                ConfigureGrpcHost(x);
            });

            ConfigureBus(configurator);

            ConfigureGrpcBus(configurator);

            configurator.ReceiveEndpoint(InputQueueName, e =>
            {
                ConfigureReceiveEndpoint(e);

                ConfigureGrpcReceiveEndpoint(e);
            });
            return(configurator.Build(_busConfiguration, _specifications ?? Enumerable.Empty <ISpecification>()));
        }