Skip to Content

category

Category: NServiceBus

post

Webcast about SOA, DDD & CQRS with NServiceBus

I will be giving a Webcast tomorrow about SOA, DDD, CQRS with NServiceBus in Spanish. In this talk I will cover the DDD strategic design, bounded contexts and how to model domain logic through NServiceBus Sagas.

You can see the details in the following link:

post

NServiceBus: DRY with unobtrusive conventions

Many times when working with NServiceBus in unobtrusive mode you may feel that you are repeating the same conventions over and over again on all the endpoints.

The IWantToRunBeforeConfiguration interface is a great help in order to embrace the DRY principle.

Just define your implementation in an assembly referenced by all the endpoints:

public class UnobtrusiveConventions : IWantToRunBeforeConfiguration
{
    public void Init()
    {
        Configure.Instance
            .DefiningCommandsAs(t => t.Namespace != null
                && t.Namespace.EndsWith("Commands"))
            .DefiningEventsAs(t => t.Namespace != null
                && t.Namespace.EndsWith("Events"))
            .DefiningMessagesAs(t => t.Namespace != null
                && t.Namespace.EndsWith("Messages"));
    }
}

and NServiceBus will pick this class automatically for each endpoint.