Esempio n. 1
0
        private static async Task Main(string[] args)
        {
            var config     = ConfigurationCreator.GetConfiguration();
            var routerName = config["NServiceBus:EndpointName"];

            Console.Title = routerName;

            var routerConfig  = new RouterConfiguration(routerName);
            var staticRouting = routerConfig.UseStaticRoutingProtocol();

            RouteFromAzureToAzure(config, routerConfig, staticRouting);
//            RouteFromLearningToAzure(routerConfig, config, staticRouting);
//            RouteFromAzureToLearning(routerConfig, config, staticRouting);

            routerConfig.AutoCreateQueues();
            routerConfig.PoisonQueueName = $"{routerName}-poison";

            var router = Router.Create(routerConfig);
            await router.Start().ConfigureAwait(false);

            Console.WriteLine("Press <enter> to exit");
            Console.ReadLine();

            await router.Stop().ConfigureAwait(false);
        }
Esempio n. 2
0
        private static async Task Main(string[] args)
        {
            configuration         = ConfigurationCreator.GetConfiguration();
            endpointConfiguration = new EndpointConfiguration(configuration["NServiceBus:EndpointName"]);

            ConfigureTransportAndRouting();
//            UseLearningTransport();

            ConfigureSerialization();
            ConfigureRecoverability();
            ConfigureLogging();

            endpointConfiguration.SendOnly();

            var endpointInstance = await Endpoint.Start(endpointConfiguration).ConfigureAwait(false);

            Console.WriteLine($"Sending command: {nameof(SendCommandFromEndpointA)}...");

            var sendOptions = new SendOptions();

            sendOptions.SetDestination("proto-router-endpoint-a");
            await endpointInstance.Send(new SendCommandFromEndpointA(), sendOptions).ConfigureAwait(false);

            await endpointInstance.Stop().ConfigureAwait(false);
        }
Esempio n. 3
0
        private static async Task Main(string[] args)
        {
            configuration         = ConfigurationCreator.GetConfiguration();
            endpointConfiguration = new EndpointConfiguration(configuration["NServiceBus:EndpointName"]);

            ConfigureTransportAndRouting();
//            UseLearningTransport();

            ConfigureSerialization();
            ConfigureRecoverability();
            ConfigureLogging();

            endpointConfiguration.EnableInstallers();

            var endpointInstance = await Endpoint.Start(endpointConfiguration)
                                   .ConfigureAwait(false);

            Console.WriteLine("Press <enter> to exit.");
            Console.ReadLine();

            await endpointInstance.Stop()
            .ConfigureAwait(false);
        }