mploed / ddd-with-spring Goto Github PK
View Code? Open in Web Editor NEWCode examples for my conference talk on implementing ddd with spring
License: Apache License 2.0
Code examples for my conference talk on implementing ddd with spring
License: Apache License 2.0
After fixing this issue locallly (by renaming the artifact in the Dockerfile)
#16
... I get this error after running
docker-compose up --build
ddd-with-spring-scoring | 2021-02-12 20:23:27.310 WARN 1 --- [ask-scheduler-1] .c.j.MappingJackson2HttpMessageConverter : Failed to evaluate Jackson deserialization for type [[simple type, class com.rometools.rome.feed.atom.Feed]]: com.fasterxml.jackson.databind.JsonMappingException: Conflicting setter definitions for property "content": org.jdom2.Element#setContent(1 params) vs org.jdom2.Element#setContent(1 params)
ddd-with-spring-scoring | 2021-02-12 20:23:28.347 ERROR 1 --- [ask-scheduler-1] o.s.integration.handler.LoggingHandler : org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://credit-agency:9002/person-rating/feed": Host is unreachable (Host unreachable); nested exception is java.net.NoRouteToHostException: Host is unreachable (Host unreachable)
ddd-with-spring-scoring | at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:743)
ddd-with-spring-scoring | at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:686)
ddd-with-spring-scoring | at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602)
ddd-with-spring-scoring | at com.mploed.dddwithspring.scoring.feeds.CreditAgencyPoller.poll(CreditAgencyPoller.java:53)
ddd-with-spring-scoring | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
..should "http://credit-agency:9002" be available in the docker network ?
I've cloned the code and ran ./mvnw clean package. Unfortunately, the compilation of the artefacts fails and therefore the Docker images cannot be built. Is there a special Java version dependency or am I missing sth. else in my configuration?
Suggestion: what if you add a multi-stage build to your Dockerfile to ensure the correct Java and tooling versions?
[INFO] Reactor Summary:
[INFO]
[INFO] assets ............................................. SUCCESS [ 3.991 s]
[INFO] credit-sales-funnel ................................ SUCCESS [ 0.827 s]
[INFO] microarchitecture .................................. SUCCESS [ 0.238 s]
[INFO] sharedmodel ........................................ SUCCESS [ 0.287 s]
[INFO] aggregates ......................................... SUCCESS [ 0.743 s]
[INFO] application-services ............................... SUCCESS [ 0.033 s]
[INFO] adapters-input ..................................... SUCCESS [ 0.083 s]
[INFO] adapters-output .................................... FAILURE [ 0.080 s]
[INFO] scoring-application ................................ SKIPPED
[INFO] ddd-with-spring 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] scoring ............................................ SKIPPED
[INFO] credit-agency 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.098 s
[INFO] Finished at: 2020-05-02T20:17:11+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project adapters-output: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.: NullPointerException -> [Help 1]
java --version:
java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
The credit-sales-funnel module was renamed from credit-sales-funnel-springbootapp but docker file in module was not changed. Therefore docker could not find artifact credit-sales-funnel-springbootapp-0.0.1-SNAPSHOT.jar
Hi @mploed!
Thanks for creating this public example. I like the idea to use package-scoping to hide the aggregate's containing entities and value objects from the public, although this is quite different from the "usual" hexagonal package structure (e.g. in Vaughn Vernon's IDDD samples).
In your "scoring" module, repositories (e.g. ApplicantResultRepository
, FinancialSituationResultRepository
) are placed inside the "adapters-output" submodule. The submodule also includes projections like the ApplicantResultProjection
which is used as a return type of the ApplicantResultRepository
's methods. The ApplicantResultRepository
as well as the ApplicantResultProjection
is used in the ScoringApplicationService
.
This creates a dependency from the Application Layer (outwards) to the Driven (Output) Adapter which breaks the dependency rule that says that source code dependencies can only point inwards. Would you move the projections? They are a technical concern of the Output Adapter (which is clearly illustrated by JPA's @Entity
, @Id
... annotations), so I'd agree it they stay there. But that doesn't solve the issue. What's your opinion and idea on this? Would you agree that the domain part of the repository interface (= ApplicantResultRepository#save(ApplicantAggregate)
) should belong to the domain model (which is currently separated into the "aggregates" and "sharedmodel" submodules)?
Currently, the ScoringApplicationService
is living inside the "adapters-input" submodule. I think it should be moved to the "application-services" submodule which is currently empty.
Hi,
I'm getting the below compilation error. Any support is appreciated
Non-resolvable parent POM for com.mploed.dddwithspring:scoring:0.0.1-SNAPSHOT: Could not find artifact com.mploed.dddwithspring:parent:pom:0.0.1-SNAPSHOT
Hello,
I have some doubts about a location of ScoringResultRepository. Maybe better choise is rename this class to
for instance ScoringResults, and then moved to your domain package (module).
(Also the aggreagates maven module rename to model or domain for instance scoring-model as a name of module).
Look at this project:
https://github.com/ddd-by-examples/factory
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.