Comments (4)
Lets imagine that the external service is not available for e.g. 24h. How do you solve this case with synchronous communication?
from banking-kata-java.
Hi Steve,
if the external service is not available for 24h, it is no longer a technical problem. You should better think about why are you communicating with a service that offers so low availability.
Option 0: ignore the problem. Not possible?
So: option 1: do not communicate with this service.
Of course it can be the only possible solution at a certain period of time (but again: a business choice with deep technical consequences).
Option 2: is it possible to ask the team responsible for the service to offer an asynchronous endpoint? Or
Option 3: is it possible to use change data capture to send the data to an event log?
No? Option 4: add caching if it makes any sort of sense.
No? Option 5: pull data to an internally maintained database.
All these options (and better ones I didn't think about) in case we communicate to fetch data, not to write data (in which case I would put a message broker/event log in the middle to prevent loss of data).
There is of course the case where we do not have to be worried about the external service not being available for long time, which is often the case, when you ask your PO to ask the other PO to add asynchronous communication and the answer is "it doesn't fit in the roadmap" so you do need to communicate synchronously.
But more importantly, what is your take on this?
from banking-kata-java.
I think it could make sense to have an example of both synchronous communication (request/response) and asynchronous (event-based) to illustrate both. I'm actually thinking of including this as preparation for the next meetup because I wanted to illustrate contract testing, communication with other microservices & third-party systems.
Thanks @TristanoSuriani , "For example, in case of opening a new account, checking that a person exists and is registered in the country." Synchronous implementation is simple there...
@schneidersteve what are your ideas for implementing it asynchronously? (i.e. checking whether person is registered in the country)
from banking-kata-java.
@valentinacupac writing asynchronously from the perspective of the use case is the same as writing it synchronously, as it is abstracted by the port. Changing an existing implementation from synchronous to asynchronous would mean changing only the implementation of the adapter and eventually adding some idempotent key to the entity. Some considerations should be made in deciding where to implement logic for deduplication. Should it be treated as a technical concern? Outside the hexagon. Should it be seen as a functional concern? Inside the hexagon.
Reading asynchronously means waiting for an event that triggers a new use case.
from banking-kata-java.
Related Issues (20)
- Adapter - Persistence - JDBC - SQL HOT 2
- Adapter - Persistence - File
- Adapter - Persistence - JDBC - Stored Procedures HOT 2
- GitHub - Run tests before merge to main HOT 1
- Refactoring Tests - Base Adapter Tests - Test Structure
- Event Sourcing - EventStoreDB
- BankAccount - Event Sourcing
- Bank Account - Domain Events
- Flyway - Error when executing locally HOT 4
- SonarQube - Configuration - Rule Exclusion HOT 1
- MongoDB - Error when run locally HOT 8
- Centralize environment variables
- Adapter - Messaging - RabbitMQ - receiveAndConvert HOT 2
- Adapter - Messaging - RabbitMQ - Pattern Matching for instanceof HOT 1
- SonarQube Metrics Review
- Failure on Project Setup
- Local Testing - RabbitMQ
- GitHub - Fix SonarQube HOT 6
- GitHub - Component Test
- CQRS and Event Sourcing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from banking-kata-java.