Commands and Events

Messaging can help us to achieve loose coupling between components by introducing asynchronous fire and forget communication, this also help us maintain the autonomy of our component and preserve logical “Service” boundaries.

In general by using explicit naming, it should be clear what it is you expect the message handler to do. Combined with the “Single Responsibility Principle” (SRP) we can achieve better decomposition of our systems. For example, “UpdateUser” says very little about what this method is actually doing, while “UpdateUserPhoneNumber” or “ChangeUserPassword” is more like it :-).

It also means we are starting to slice and dice our entity to smaller units/properties that do only one thing, they change the state of the fields that reflect the unit of work’s effect of the state change (my mobile phone number has been created). Using the Command/Event semantics clarifies what is the intent and logical boundary of a message.

Commands: - Internal communication between components inside the boundary of a logical “Service” is done using commands. - Commands (as the name implies) can command another component within the boundary of the logical “Service”. - They change the state of the processing component. - They contain the data and context that the component (handler) needs in order to execute its task. - Commands are “Sent” (using bus.Send() using NServiceBus) to exactly one component (handler) (one to one communication).

Events: - Events are used for cross logical “Service” communications. - They notify of things that happened in the past. - They are light and contain only reference data like Ids and a small amount of context data. - Events are published (bus.Publish() using NServiceBus) - There is only one logical publisher and one or more subscribers. - Events can also be used inside a logical “Service” between internal loosely coupled components. To summaries: Use Commands with data inside you logical “Service” boundary to change state. Use Events with reference data for cross logical “Service” communications. Follow the Single Responsibility Principle, it will help reduce the size of your units of work. Reducing coupling is our objective.

Microservices group Dublin 28 September 2016

I gave my Building (Micro) services talk to the Dublin Microservices user group.

I want to thank the organisers Sean and Leanne and the hosts Gilt Group.
The slides are here

Surf Office meetup London 21 Sept.

I had the opportunity to talk about how we (in Particular Software) work as a dispearsed company at the Surf Office meetup in London We, Laïla von Alvensleben Anna Chiara Bellini and I each gave a talk and then we had a Q&A session, more details here:

Krakow User Group Wed, 14 September

We organized a company meetup for the the European part of Particular Software in Krakow.

Being a dispersed company (we all work remotely) it was great to meet everyone in person.

As we where already in Krakow we managed to give back to the comunity, Daniel Marbach and I gave two talks at Krakow User Group (It is only in polish :-)) (slides here)

We then stayed on to attend the DevDay conference in Krakow, William Brander gave his session “So You Wanna Build a Service Bus?”, it was a good confrance with a lot of great speakers!

Dublin Microservices user group May 2016

I had the opportunity to present my new talk “SOA lessons learnt (OR Microservices done better)” to the Dublin Microservices group.

The slides are here, the recording is here.

Stefan Tilkov also gave his talk “Wait, what!? Our microservices have actual human users?”, It was very interesting, I like his Idea of the browser as a platform. Stefan’s deck if here, the recording is here.

I want to thank the group organisers, the hosts Gilt for a great event.

Happy New Year!

2014 seam to have flown by…

Lots of exiting things happened, some public some private.
I can say I’ve learnt a lot and had the opportunity to speak at NSBCon NYC and the WebSummit Dublin, attended great conferences like Craft in Budapest, NSBCon London and NYC, Build Stuff in Vilnius, I met a lot of interesting people and learn a lot of interesting things i don’t get to do on my day to day work.

On the work front was also very interesting and i’m looking forward to this new year.

Happy New Year!

NSBcon London 2014 the first NServiceBus conference

I spent the last week in London and attended two events relating to NServiceBus.

The ADSD unconformance was my first unconference , and it was very interesting. The attendances are alumni of Udi Dahan’s Advanced Distributed Systems Design with SOA course.

The ADSD course had been running for the last couple of years all over the world and I had the opportunity to meet up with the guys I did the course with in Stockholm.

I was the caretaker of two sessions, one was about “3rd party integration and Service Boundaries” and the other was titled “How are you using NServiceBus”.

All discussions where very interesting and a chance to hear what other developers are thinking, doing and are puzzled about with NServiceBus and SOA. IMG_1962 Thursday and Friday it was NSBCon, it was the first NServiceBus conference and so it is a major milestone for NServiceBus users and the Particular platform.

IMG_1966 Udi started with the keynote, NServiceBus Past, Present, and Future, apologizing for the past :-) doing a bit of a retrospective and excited about the future of NServiceBus and the Particular platform. IMG_1968 Charlie Barker (@Porkstone) one of the dinosaurs of Wonga talked about why and how they are using NServiceBus at Scale IMG_1970 Yves Goeleven (@YvesGoeleven) talked about NServiceBus and Azure called NServiceBus on the Windows Azure Platform IMG_1971 James Lewis (@boicy) talked about Managing Microservices IMG_1972 Roy Cornelissen (@roycornelissen) and Mark Taling (@MarkTaling) gave the Embracing NServiceBus – Best Practices talk IMG_1974 Then Yves Goeleven (@YvesGoeleven), James Lewis (@boicy) and Andreas Ohlund (@andreasohlund) did a Q&A session titled Park Bench Panel Discussion That was the end of day one and we all went to the pub/dinner where the conversations went on… IMG_1976 On Friday we started with Danny Cohen and he did a Deep dive into the Particular Service Platform IMG_1977 Jan Ove Skogheim (@janovesk) talked about the move from layered Web Services to an Event-driven Architecture at Rikstoto IMG_1978 Dylan Beattie (@dylanbeattie) of Spotlight told us about Media Publishing Workflows using NServiceBus IMG_1979 Indu Alagarsamy (@Indu_alagarsamy) and John Simons (@ohnsimons_) did a talk about the new pipeline called NServiceBus - Lego Style IMG_1980 Andreas Ohlund (@andreasohlund) talked about the core development team process, tools and values in his slice Under the Hood of Particular Software IMG_1982 Greg Young (@gregyoung) and Szymon Pobiega (@zymonPobiega) reviewed Event Store and NServiceBus including the Event Store Transport IMG_1984 To Wrap up Udi Dahan gave the Closing Notes IMG_1967 Andreas gave the thumbs up and Udi announced the release of NServiceBus 5.0 Beta! All and all it was a great conference, it was nice to see the developers using NServiceBus, some of which i know from github or twitter in the flesh… Looking forward to the conference next year :-) and the next one NSBCon NYC 2014 - All about NServiceBus