0

trying to start with nservicebus. My intent is to at least get the log message that the endpoint is trying to subscribe. So I created message handler for message like

namespace BusStop.Billing
{
    public class OrderAcceptedHandler : IHandleMessages<OrderAccepted>
    {
        public void Handle(OrderAccepted message)

and the contract OrderAccepted is defined as

namespace BusStop.Sales.Contracts
{
    public class OrderAccepted : IMessage
    {

As per NServiceBus documentation, it should be sufficient to modify the subscriber .config file

<UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="BusStop.Sales.Contracts" Endpoint="BusStop.Backend"/>

however when i start subscriber host NServiceBus.Host.exe I am not getting log message that it is trying to subscribe nor there is subscription request message in busstop.backend queue.

Thanks.

Ivan
  • 1,254
  • 12
  • 25

1 Answers1

1

Ok, so the problem was you have to also mark your message with IEvent interface, because this is

Ivan
  • 1,254
  • 12
  • 25
  • 1
    Correct, as of v4 only messages marked as events are autosubscribed. – Andreas Öhlund Feb 23 '14 at 17:25
  • Also, a better way to manage your message schema is to not use, ICommand, IEvent, IMessage and reference NServiceBus, but instead use POCO classes and then define conventions so NServiceBus knows how to classify your POCOs. For more information, see: http://particular.net/articles/unobtrusive-mode-messages – Indu Alagarsamy Feb 24 '14 at 17:08