40
Taking the hippie bus to the enterprise GOTO Aarhus September 30th 2013

Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Embed Size (px)

Citation preview

Page 1: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Taking the hippie bus to theenterprise

GOTO AarhusSeptember 30th 2013

Page 2: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Mogens Heller Grabe

[email protected]

http://mookid.dk/oncode

@mookid8000

Page 3: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

What?What's your problem?Meet RebusExamplesWrap up

Page 4: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

How?SlidesTalk4 demos

Page 5: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

What's yourproblem?

Page 6: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Big system

size

Page 7: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Integration with externalparties

(uhm hello? anybody out there?)

Page 8: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Complex logicStuff that makes stuff happen

...that makes other stuff happen

...that makes other stuff happen

...then waits for a while

...then other stuff happens

(you probably get it)

Page 9: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Problem summaryMonolithIntegrationCoordination

Page 10: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

The solution: Messaging

(and by "the" I mean "a")

Page 11: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Messaging via durable,asynchronous queues

Page 12: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Windows FTW!!1

Page 13: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Meet Rebus

Page 14: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

"Service bus"?

Page 15: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

"Hippie bus"?

Page 16: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

No, seriously - what is it?Messaging libraryLayer on top of MSMQOne single .NET 4 DLLAdditional DLLs if you want RabbitMQ

RavenDBMongoDBCastle WindsorStructureMapUnityAutofacNinjectLog4netNLog...

Page 17: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

MotivationI really like NServiceBusCan't use NServiceBus where I want to thoughSometimes I lost my patience with NServiceBusWanted to use MassTransitWanted to fork NServiceBus when it was still Apache V2

Page 18: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

PhilosophyFreeEasy

Page 19: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Meta3700 lines of C# 4Code on GitHub:

Has contributions from 12 developers besides meBinaries available via NuGet

Current version: 0.43.1Has been moving money around since 0.14-alphaHas controlled power plants since 0.17-alpha

https://github.com/rebus-org/Rebus

http://nuget.org/packages?q=rebus

Page 20: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Good to knowMessages are POCOsEach Rebus endpoint has its own input queueEach message type is owned by one logical service

Page 21: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Demo 0

Page 22: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,
Page 23: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

ExamplesThe three problems I talked about

1. System that's becoming too big2. Integration with external parties3. Complex logic with coordination and timing

Page 24: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

1st problemSystem that's becoming too big

Summary: We're building a trading platform where traders in "front office" strike deals with counterpartsand record their trades, while administrative personnel in "back office" make sure that the counterparts

are charged.

Page 25: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Cuesubiquitous languagebounded contextdistributed domain-driven design

Page 26: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Demo 1Split into separate Trading and Billing systems

Page 27: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

2nd problemIntegration with external party

Summary: When new trades are made, "middle office" needs to confirm all trades, e.g. depending on thecurrent credit status of the counterpart. Credit status can be retrieved by querying the CreditAssessment

SOAP service.

Page 28: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Cuesasynchronousreliableautomatic retries

Page 29: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,
Page 30: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Demo 2Web service calls via messaging facade

Page 31: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

3rd problemComplex coordination and timing

Billing needs to charge the customer, but it can be optimized by sending one big invoice if the creditstatus is OK. Therefore, when trades are made, billing awaits confirmations' judgment to determine

invoicing terms.

To avoid "forgetting" to send invoices in case something goes wrong, we want to take action if theautomated invoicing is not complete within 10 seconds.

Page 32: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Cuesprocess managertimeoutscompensating actions

Page 33: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,
Page 34: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Demo 3Complex logic, coordination, timing

Page 35: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

SummaryMessaging provides a model that can...

help you glue the pieces together when you break down asystem into bounded contextshelp you overcome glitches when you depend on stuff thatyou do not controlbe used to make processes explicit by correlating events

Page 36: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Stuff I didn't showCan also use RabbitMQ, Azure Service Bus, and SQL Server astransportsCan store subscriptions and sagas in SQL Server, RavenDB,and MongoDBCan activate handlers with Castle Windsor, StructureMap,Autofac, Ninject, and UnityCan log with NLog and Log4NetCan send messages in batchesCan do handler pipeline re-orderingCan do polymorphic dispatchCan encrypt message bodiesCan compress message bodies

Page 37: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

What now?1.0Central monitoringHTTP gatewayAdditional transportsDistributor

Page 38: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Litterature

Page 39: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Want to read more?Check out the work & words of Udi Dahan, Greg Young, Dan

North, Rinad Abdullin etc.

Page 40: Taking the hippie bus to the enterprise - GOTO Bloggotocon.com/dl/goto-aar-2013/slides/MogensHellerGrabe_TakingThe... · Stuff I didn't show Can also use RabbitMQ, Azure Service Bus,

Thank you for listening!...and a big thank you to for creating the immensely awesome

Mogens Heller Grabe

Hakim reveal.js

Code samples on GitHub

[email protected]

@mookid8000

http://mookid.dk/oncode