Beispiel #1
0
    static void Main(string[] args)
    {
        var config = new LightRailConfiguration();
        config.AddAssemblyToScan(typeof(Program).Assembly);
        config.AddAssemblyToScan(typeof(RequestDataMessage).Assembly);
        config.UseTransport<ServiceBrokerMessageTransport, ServiceBrokerMessageTransportConfiguration>();
        config.TransportConfigurationAs<ServiceBrokerMessageTransportConfiguration>().ServiceBrokerConnectionString = "server=localhost;database=servicebus;integrated security=true;";
        config.TransportConfigurationAs<ServiceBrokerMessageTransportConfiguration>().ServiceBrokerQueue = "SamplesFullDuplexServer";
        config.TransportConfigurationAs<ServiceBrokerMessageTransportConfiguration>().ServiceBrokerService = "SamplesFullDuplexServer";

        //LogManager.Use<DefaultFactory>()
        //    .Level(LogLevel.Info);

        var client = config.CreateBus().Start();

        Console.WriteLine("Press any key to exit");
        Console.ReadKey();
    }
Beispiel #2
0
    static void Main(string[] args)
    {
        var config = new LightRailConfiguration();

        config.AddAssemblyToScan(typeof(Program).Assembly);
        config.AddAssemblyToScan(typeof(RequestDataMessage).Assembly);
        config.UseTransport <ServiceBrokerMessageTransport, ServiceBrokerMessageTransportConfiguration>();
        config.TransportConfigurationAs <ServiceBrokerMessageTransportConfiguration>().ServiceBrokerConnectionString = "server=localhost;database=servicebus;integrated security=true;";
        config.TransportConfigurationAs <ServiceBrokerMessageTransportConfiguration>().ServiceBrokerQueue            = "SamplesFullDuplexServer";
        config.TransportConfigurationAs <ServiceBrokerMessageTransportConfiguration>().ServiceBrokerService          = "SamplesFullDuplexServer";

        //LogManager.Use<DefaultFactory>()
        //    .Level(LogLevel.Info);

        var client = config.CreateBus().Start();

        Console.WriteLine("Press any key to exit");
        Console.ReadKey();
    }
Beispiel #3
0
    static void Main(string[] args)
    {
        var config = new LightRailConfiguration();

        config.AddAssemblyToScan(typeof(Program).Assembly);
        config.AddAssemblyToScan(typeof(RequestDataMessage).Assembly);
        config.UseTransport <ServiceBrokerMessageTransport, ServiceBrokerMessageTransportConfiguration>();
        config.TransportConfigurationAs <ServiceBrokerMessageTransportConfiguration>().ServiceBrokerConnectionString = "server=localhost;database=servicebus;integrated security=true;";
        config.TransportConfigurationAs <ServiceBrokerMessageTransportConfiguration>().ServiceBrokerQueue            = "SamplesFullDuplexClient";
        config.TransportConfigurationAs <ServiceBrokerMessageTransportConfiguration>().ServiceBrokerService          = "SamplesFullDuplexClient";

        //LogManager.Use<DefaultFactory>()
        //    .Level(LogLevel.Info);

        var client = config.CreateBus().Start();

        Console.WriteLine("Press enter to send a message");
        Console.WriteLine("Press any key to exit");
        while (true)
        {
            ConsoleKeyInfo key = Console.ReadKey();
            Console.WriteLine();

            if (key.Key != ConsoleKey.Enter)
            {
                return;
            }

            var guid = Guid.NewGuid();
            Console.WriteLine("Requesting to get data by id: {0}", guid.ToString("N"));

            RequestDataMessage message = new RequestDataMessage
            {
                DataId = guid,
                String = "<node>it's my \"node\" & i like it<node>"
            };
            client.Send(message, "SamplesFullDuplexServer");
        }
    }
Beispiel #4
0
    static void Main(string[] args)
    {
        var config = new LightRailConfiguration();
        config.AddAssemblyToScan(typeof(Program).Assembly);
        config.AddAssemblyToScan(typeof(RequestDataMessage).Assembly);
        config.UseTransport<ServiceBrokerMessageTransport, ServiceBrokerMessageTransportConfiguration>();
        config.TransportConfigurationAs<ServiceBrokerMessageTransportConfiguration>().ServiceBrokerConnectionString = "server=localhost;database=servicebus;integrated security=true;";
        config.TransportConfigurationAs<ServiceBrokerMessageTransportConfiguration>().ServiceBrokerQueue = "SamplesFullDuplexClient";
        config.TransportConfigurationAs<ServiceBrokerMessageTransportConfiguration>().ServiceBrokerService = "SamplesFullDuplexClient";

        //LogManager.Use<DefaultFactory>()
        //    .Level(LogLevel.Info);

        var client = config.CreateBus().Start();

        Console.WriteLine("Press enter to send a message");
        Console.WriteLine("Press any key to exit");
        while (true)
        {
            ConsoleKeyInfo key = Console.ReadKey();
            Console.WriteLine();

            if (key.Key != ConsoleKey.Enter)
            {
                return;
            }

            var guid = Guid.NewGuid();
            Console.WriteLine("Requesting to get data by id: {0}", guid.ToString("N"));

            RequestDataMessage message = new RequestDataMessage
            {
                DataId = guid,
                String = "<node>it's my \"node\" & i like it<node>"
            };
            client.Send(message, "SamplesFullDuplexServer");
        }
    }