Register Producer Command

Registers a producer with MassTransit using CLI prompts

This command will register a producer with MassTransit using CLI prompts. This is especially useful for adding a new publish action to an existing feature (e.g. EntityCreated).

This command must be ran from the bounded context directory for a project that was made using the new domain or add bc command. It should have a src and test directory.

craftsman register producer [options]

Add Feature Options

OptionDescription
-h, --helpDisplay help message. No filepath is needed to display the help message.

Register Producer Prompts

The CLI will prompt your for the following items from the producer template.

  • MessageName
  • EndpointRegistrationMethodName
  • DomainDirectory
  • ExchangeType

Updating Your Tests

One thing that Craftsman won't be able to do for you here is update your existing tests to capture the new producer you just registered. To do this, you'll want to add something like the below to your feature tests for the new producer you registered.

(await IsFaultyPublished<MESSAGENAME>()).Should().BeFalse();
(await IsPublished<MESSAGENAME>()).Should().BeTrue();

Add Feature Example Commands

craftsman register producer -h
craftsman register producer