Exemplo n.º 1
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.º 2
0
    public void GatewaySideB()
    {
        #region upgrade-gateway-config-b

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

        gatewayConfig.ForwardToEndpoint(MessageType.Parse("MyMessage, Messages"), "EndpointB");

        #endregion
    }
Exemplo n.º 3
0
    public void ConfigureDestinationGateway(WormholeGatewayConfiguration <MsmqTransport, MsmqTransport> config)
    {
        #region DestinationEndpoints

        config.ForwardToEndpoint(MessageType.Parse("MyMessage, Messages"), "EndpointA");
        config.ForwardToEndpoint("OtherMessages", "SomeNamespace", "EndpointB");
        config.ForwardToEndpoint("OtherMessages", "EndpointB");

        #endregion

        #region SSD

        config.EndpointInstances.AddOrReplaceInstances(
            sourceKey: "SSD",
            endpointInstances: new List <EndpointInstance>
        {
            new EndpointInstance(endpoint: "ScaledOutEndpoint").AtMachine("Host1"),
            new EndpointInstance(endpoint: "ScaledOutEndpoint").AtMachine("Host2")
        });

        #endregion
    }