Presentation is loading. Please wait.

Presentation is loading. Please wait.

NServiceBus – Getting Started

Similar presentations


Presentation on theme: "NServiceBus – Getting Started"— Presentation transcript:

1 NServiceBus – Getting Started
Sean Feldman Highco Consulting Ltd / Particular Software

2 Messages – Commands and Events
Known destination (unicast) Instructs recipient to perform an action Indicates sender knowledge of recipient Event Unknown destinations (multicast) Immutable representation of something that occurred in the past Command and Events are messages with Semantic Meaning. NServiceBus enforces the semantic of command and events.

3 Messaging Patterns

4 Request / Response A message is sent to a specific destination
The sender perfectly knows the receiver Knows where the receiver is Knows what to send The receiver of the message can reply back The receiver Does not necessarily know directly where the request is coming from Knows what the sender expects: what to reply There is coupling between the sender and the receiver

5 Publish / Subscribe An actor in the system acted on something
The actor can broadcast an event to the entire system The publisher is not interested in who is subscribed for the event Another actor in the system can be interested in an event The actor will subscribe to the event(s) interested in Subscription is responsibility of the interested side to receive events The subscriber knows the publisher, not the opposite A copy of an event is delivered to each subscriber* There is less coupling between the publisher and the subscriber * Persistence based vs broker based pub/sub

6 Message Handlers

7 Message Handlers A handler is the “container” (class) that hosts our code Each time a message is received a handler is invoked A handler is stateless: Each time a message is received a new handler is created and invoked* A handler either succeeds or fails and that affects what will happen to the processed message * Stateful scenarios with Sagas – topic for a whole another meetup

8 Endpoints & Hosting

9 Endpoints & Hosting Handlers are grouped by service (a logical concept) Services are hosted in Endpoints Endpoint instances run on Windows machines Windows Services Self hosted Leverage the NServiceBus.Host (Self) hosted in any application type: web, console, WPF, etc.

10 Transports

11 Transports Oracle MSMQ AmazonSQS RabbitMQ SQL Server
Azure Storage Queues Azure Service Bus

12 Persistence

13 Persistence MongoDB NHibernate PostgreSQL RavenDB DocumentDB
Azure Storage

14

15 A Story of a Lost Notification
Book I

16 Demo / Temporal Coupling
Register a new user. When registration is done, send a welcome notification.

17 Demo / Pub-Sub Marketing is interested in newly created users

18 Show me the code

19 Thank you Learn to design better systems
Get access to 2 full days of Udi Dahan's Advanced Distributed Systems Design video course. Sign up here: Access code: Calga Expiration date: Nov 3rd


Download ppt "NServiceBus – Getting Started"

Similar presentations


Ads by Google