How route request to specific instance

Viewed 83

My configuration looks like this:

Endpoint1 uses RabbitMQTransport <=> Bridge <=> Endpoints on multiple machine uses MsmqTransport.

I want to send a request to a specific machine:

    public Task<TResponse> SendRequest(TRequest request)
    {
        IBaseMessage msg = (IBaseMessage)request;
        var sendOptions = new SendOptions();
        sendOptions.RouteToSpecificInstance($"{msg.MachineHost}");
        return endpointInstance.Request<TResponse>(request, sendOptions);
    }

Reuquest raises an exception

System.Exception: „Routing to a specific instance is only allowed if route is defined for a logical endpoint, not for an address or instance.”

Strange becouse endpoin is configured:

        var routingSettings = transport.Routing();
        var bridge = routingSettings.ConnectToBridge("Transport.RabbitMq");
        bridge.RouteToEndpoint(typeof(GetProgramPlacements), "MachineCommanderService");

I have no idea how to solve it.

0 Answers
Related