Already specified routing option for this message: ExplicitDestination

Hi Guys… I receive an error while trying to send a command

var options = new SendOptions();
                options.SetDestination(EndpointNames.Api);
                options.RouteToSpecificInstance(userConnection.ApiInstanceName);

                await context.Send(new UpdateSwapReport
                {
                    ConnectionId = userConnection.ConnectionId,
                    Item = message.Item
                }, options);

Already specified routing option for this message: ExplicitDestination

whats wrong there?

Guys… your sample is broken!

Check https://docs.particular.net/nservicebus/messaging/routing

var options = new SendOptions();
options.RouteToThisInstance()
options.RouteToSpecificInstance("B");
endpointInstance.Send(new MyMessage(), options);

Throws

Already specified routing option for this message: RouteToThisInstance

hey @Kamil_Wojciechowski

thanks for bringing this up, the snippet is indeed incorrect and I’ve fixed that now. It should be updated on the live docs soon.

The issue with the snippet as well as the first code you’ve posted are conflicting routing configurations.
In your first case SetDestination hardcodes the destination address, preventing any routing logic from happening, while RouteToSpecificInstance is supposed to use the regular routing and then adjust the determined route with the configured instance.

let me know if you have further questions about the routing configuration.

thanks for reply,
i used setdestination and i put there my callback queue full name - now works as expected