상속: IDisposable, IBus
예제 #1
0
        /// <summary>
        /// Factory method. Create and run service bus
        /// </summary>
        public static IServiceBus Run(Func <ServiceBusConfiguration, ServiceBusConfiguration> configurationAction)
        {
            var config = new ServiceBusConfiguration();

            configurationAction(config);
            var bus = new ServiceBus(config);

            bus.Run();
            return(bus);
        }
예제 #2
0
        static void Main(string[] args)
        {
            var config = new Configuration(AppDomainUnityContext.Current)
                .SetInputQueue("PSB.App2.Input")
                .SetErrorQueue("PSB.App2.Error")
                .AddEndpoint("Shared.ClientMessages", "PSB.App1.Input")
                .AddHandlers(typeof(Program).Assembly);

            var bus = new ServiceBus(config);
            bus.Run();

            Console.WriteLine("Server started. Press enter to send message");

            while (true)
            {
                Console.ReadKey();

                var message = new SayHelloToClientMessage() { Message = "Hello Client!" };
                bus.Send(message);
            }
        }
예제 #3
0
 /// <summary>
 /// Factory method. Create and run service bus
 /// </summary>
 public static IServiceBus Run(Func<ServiceBusConfiguration, ServiceBusConfiguration> configurationAction)
 {
     var config = new ServiceBusConfiguration();
     configurationAction(config);
     var bus = new ServiceBus(config);
     bus.Run();
     return bus;
 }