Recently, I've written extensively about implementing a hexagonal architecture.
One issue that came up as feedback was that the app uses shared mutable state. It sets up a session bean, so that the driver adapter can contact the driven adapter to add the result data to Spring's MVC model. Shared mutable state and blocking operations can be an impediment in a production setting.
I just wanted to inform you that I created a new version of both the sample hexagon core, and the Spring Boot adapter. The application:
- let's you configure if you want to return the poem data to the driver adapter (e.g. the Spring Controller), or pass it on to a driven adapter (e.g. the ConsoleWriter)
- accesses the hexagon in an asynchronous way, but allows you to wait for the result
- avoids shared mutable state
You find the hexagon core in this project:
https://github.com/bertilmuth/poem-hexagon-nextgen
You find the Spring Boot adapter in this project:
https://github.com/bertilmuth/poem-springboot-nextgen
I know that is just a short summary. If you have any questions or need for further information, just let me know.
Acknowledgements
Kudos to Willi Schönborn and JuanMGP for their patience and ideas.
Top comments (1)
Hey folks. I wanted to let you know that the projects mentioned here no longer exist.
The reason is that
a) I rewrote the original article to no longer use shared mutable state
b) the information how to build such an application is now mostly contained on the requirements as code website.
If you have a question, don't hesitate to ask!