Upgrade Version 1 to 2

Component: Callbacks

Enable callbacks

Callbacks have been made opt-in. In order to make callbacks work they have to be enabled explicitly.

2.x NServiceBus.Callbacks
var instanceDiscriminator = ConfigurationManager.AppSettings["InstanceId"];
endpointConfiguration.MakeInstanceUniquelyAddressable(instanceDiscriminator);
endpointConfiguration.EnableCallbacks();

Enabling callbacks in default mode requires the endpoint to be made uniquely addressable.

Enable callbacks without requests

Endpoints only replying to callbacks with object messages like the following:

2.x NServiceBus.Callbacks
public class Handler :
    IHandleMessages<Message>
{
    public Task Handle(Message message, IMessageHandlerContext context)
    {
        var responseMessage = new ResponseMessage
        {
            Property = "PropertyValue"
        };
        return context.Reply(responseMessage);
    }
}

don't require a reference to the callbacks package.

For endpoints replying with int or enum callbacks the callbacks can be enabled in response-only mode like the following:

2.x NServiceBus.Callbacks
endpointConfiguration.EnableCallbacks(makesRequests: false);

Last modified