Building a recommendation system
To ensure we can focus on the important pieces of building a microservice using DDD principles, I have provided some sample code for this chapter. It’s available here: https://github.com/PacktPublishing/Domain-Driven-Design-with-GoLang/tree/main/chapter6. In the repository, you will find an already completed Go program called partnerships
. This is an API that gives back a response in the preceding format. However, to make it represent the system described previously, 30% of all requests will fail. You can run this program by running docker-compose up
.
Once running, you can type the following into your terminal:
curl --location --request GET 'http://localhost:3031/partnerships?location=UK'
If you do this a few times, you will notice you get one of two responses back. One is a 500 response, with no body. The other is this:
{ "availableHotels": [ &...