Developers are dealing with more integrations today than ever before, and handling consistency and reliability across those connections isn't getting any easier either. Many developers are already using NServiceBus in the core parts of their systems for the reliability it brings but aren't aware that it can also help with integration as well. Come see how the saga capabilities in NServiceBus make integration code simpler, more robust, and testable.
10. The usual way
public void Handle(OrderPlaced message)
{
var order = new Order{ Id = message.OrderID };
order.TrackingCode = fedex.BookPickup(order);
order.Status = ShippingStatus.PickupBooked;
repository.Save(order);
}
11. The usual way
public void Handle(OrderPlaced message)
{
var order = new Order{ Id = message.OrderID };
2: order.TrackingCode = fedex.BookPickup(order);
3: order.Status = ShippingStatus.PickupBooked;
repository.Save(order);
}
12. The usual way
public void Handle(OrderPlaced message)
{
var order = new Order{ Id = message.OrderID };
2: order.TrackingCode = fedex.BookPickup(order);
This might take a while!
3: order.Status = ShippingStatus.PickupBooked;
repository.Save(order);
}
52. A more scalable design
Request Send
Ticket - come back in T
http://fedex.com/responses/xyz123
Client Server
53. A more scalable design
Request Send
Ticket - come back in T
http://fedex.com/responses/xyz123
Client Server
Recv
Cache
54. A more scalable design
Request Send
Ticket - come back in T
}
http://fedex.com/responses/xyz123
Client T Server
http://fedex.com/responses/xyz123
Recv
Cache
55. A more scalable design
Request Send
Ticket - come back in T
}
http://fedex.com/responses/xyz123
Client T Server
http://fedex.com/responses/xyz123
Recv
Response / come back in T2 Cache
56. A more scalable design
Request Send
Ticket - come back in T
}
http://fedex.com/responses/xyz123
Client T Server
http://fedex.com/responses/xyz123
Recv
Response / come back in T2 Cache
57. A more scalable design
Request Send
Ticket - come back in T
}
http://fedex.com/responses/xyz123
Client T Server
http://fedex.com/responses/xyz123
Recv
Response / come back in T2 Cache
58. Using sagas to control
BookShipment
message flow
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
59. Using sagas to control
BookShipment
message flow
Get ticket
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
60. Using sagas to control
BookShipment
message flow
Get ticket
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
61. Using sagas to control
BookShipment
message flow
Get ticket
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
62. Using sagas to control
BookShipment
message flow
Get ticket
Wake me up in T
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
63. Using sagas to control
BookShipment
message flow
Get ticket
Wake me up in T
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
64. Using sagas to control
BookShipment
message flow
Get ticket
Wake me up in T
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
Get Data
65. Using sagas to control
BookShipment
message flow
Get ticket
Wake me up in T
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
Get Data
66. Using sagas to control
BookShipment
message flow
Get ticket
Wake me up in T
Integration Fedex
Timeout Fedex
Saga Endpoint
Manager
Get Data
Good DDD but still dangerous\nWorks well in test, but takes a long time in production\nKeeps the transactions open longer (other handlers can have opened the db connection\nFallacy: Latency is zero\n
Good DDD but still dangerous\nWorks well in test, but takes a long time in production\nKeeps the transactions open longer (other handlers can have opened the db connection\nFallacy: Latency is zero\n
\n
\n
\n
\n
\n
\n
\n
\n
Find a way to break up the process\nIntroducing a new status\n
Find a way to break up the process\nIntroducing a new status\n
\n
Consistent processing of orders\n
Consistent processing of orders\n
Consistent processing of orders\n
Consistent processing of orders\n
Consistent processing of orders\n
\n
Fallacy: the network is reliable\nRetries might cause problems\nNot idempotent\n \n\n
Fallacy: the network is reliable\nRetries might cause problems\nNot idempotent\n \n\n
Fallacy: the network is reliable\nRetries might cause problems\nNot idempotent\n \n\n
Requires collaboration with the other party\nNServiceBus preserves message ids even across the error queue\n\n
Requires collaboration with the other party\nNServiceBus preserves message ids even across the error queue\n\n
Requires collaboration with the other party\nNServiceBus preserves message ids even across the error queue\n\n
Requires collaboration with the other party\nNServiceBus preserves message ids even across the error queue\n\n
Requires collaboration with the other party\nNServiceBus preserves message ids even across the error queue\n\n
Requires collaboration with the other party\nNServiceBus preserves message ids even across the error queue\n\n
Requires collaboration with the other party\nNServiceBus preserves message ids even across the error queue\n\n
Partner might charge per call\nOn a device with limited battery or where traffic cost might be high\n
\n
Sleep locks up threads, bad for throughput\nSleep doesn’t survive restarts\nMessage based alarm clock\n
You play according to their rules\nDragons need to control the pace of the raiding parties\nMust do throttling to be scalable\nImpossible to maintain SLA’s otherwise\n
\n
The \n
The \n
The \n
\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Msmq.Send is very quick, 7000msg/s given no DTC\nAdjust T to tune the load\nResponses can be served of different servers\nCQRS\nCallback protocol can be used if the number of clients are small (REST / HTTP)\n
Picture == the essence of sagas\n * Only control logic\n\n
Picture == the essence of sagas\n * Only control logic\n\n
Picture == the essence of sagas\n * Only control logic\n\n
Picture == the essence of sagas\n * Only control logic\n\n
Picture == the essence of sagas\n * Only control logic\n\n
Picture == the essence of sagas\n * Only control logic\n\n
Picture == the essence of sagas\n * Only control logic\n\n
Picture == the essence of sagas\n * Only control logic\n\n
\n
\n
\n
If we learn to manage our dragons they can be of great use\nTell the story on how we built our own queuing system\n\n
If we learn to manage our dragons they can be of great use\nTell the story on how we built our own queuing system\n\n