Exemplo n.º 1
0
    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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 3
0
    public void GatewaySideA()
    {
        #region upgrade-gateway-config-a

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

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

        #endregion
    }
Exemplo n.º 4
0
    public void ConfigureGateways(
        WormholeGatewayConfiguration <LearningTransport, LearningTransport> configSiteA,
        WormholeGatewayConfiguration <LearningTransport, LearningTransport> configSiteB)
    {
        #region RemoteSiteA

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

        #endregion

        #region RemoteSiteB

        configSiteB.ConfigureRemoteSite("SiteA", "Gateway.SiteA");

        #endregion
    }