static async Task AsyncMain()
    {
        Console.Title = "Samples.Wormhole.PingPong.GatewayA";

        var gatewayConfig = new WormholeGatewayConfiguration <MsmqTransport, HttpTransport>("Gateway.SiteA", "SiteA");

        #region ConfigureGatewayA

        gatewayConfig.ConfigureRemoteSite("SiteB", "Gateway.SiteB");

        #endregion

        //Hack necessary to make 6.3.x MSMQ work
        gatewayConfig.CustomizeLocalTransport(
            customization: (configuration, transportExtensions) =>
        {
            var settings = transportExtensions.GetSettings();
            settings.Set("errorQueue", "poison");
        });

        var gateway = await gatewayConfig.Start()
                      .ConfigureAwait(false);

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

        await gateway.Stop()
        .ConfigureAwait(false);
    }
Example #2
0
    static async Task AsyncMain()
    {
        Console.Title = "Samples.Wormhole.PingPong.GatewayA";

        var gatewayConfig = new WormholeGatewayConfiguration <MsmqTransport, HttpTransport>("Gateway.SiteB", "SiteB");

        #region ConfigureGatewayB

        gatewayConfig.ConfigureRemoteSite("SiteA", "Gateway.SiteA");
        gatewayConfig.ForwardToEndpoint("Contracts", "Samples.Wormhole.PingPong.Server");

        #endregion

        //Hack necessary to make 6.3.x MSMQ work
        gatewayConfig.CustomizeLocalTransport((c, t) => t.GetSettings().Set("errorQueue", "poison"));

        var gateway = await gatewayConfig.Start()
                      .ConfigureAwait(false);

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

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