holisticon / ranked Goto Github PK
View Code? Open in Web Editor NEWTracking kicker results
License: Other
Tracking kicker results
License: Other
AxonFrameowrk 3.1 introduced QueryHandlers
as components that typically read data from the view models created by the Event listeners. Add them into application.
you can call
http://localhost:8081/view/user
to get a list of all users with id, name and imageUrl
its hard to read the test results because its spammed with framework DEBUG info
currently, it uses build
, switch to image
so far it is possible to send a createMatchCommand without any sets.
If the players decide to start playing right away, there must be an option to specify the player names after a game in an intuitive manner.
Preferably the same UI, which is used to play the sets, is utilized.
In the frontend it should not be able to select the same player multiple times for one match.
related to #1 : provide a get-mapping that delivers a ranking of players by elo-value.
I noticed the following when I do docker-compose up
:
this does not cause a problem or duplicate values, but doesn't look nice.
and just configure the dockets
We want to display the user picture so the url to this image has to be stored when users are created.
new minor is out
Currently, single properties ale loaded via @Value
Spring Annotation and then gathered to a single properties object in order to pass around.
In order to improve readability of the code, implement @ConfigurationProperties
-way using Kotlin.
At the end of a match the frontend should send an array of MatchSets to the backend. Therefore we need to save the result of each set on a heap while playing a match.
Additionally we can fill the set counter with the current set number based on this heap.
Axon Frameowrk supplies metadata for fired events including the timestamp of event creation. Use this instead of polluting the command and event models with time information.
I had to remove the apiInfo part from the Docket because after updating to springfox 2.7.0 it failed
// TODO: had to remove this because it fails with 2.7.0 ... api changed
// .apiInfo(ApiInfo(
// "Ranked Command API",
// "Command API to record new match results in ranked.",
// "1.0.0",
// "None",
// Contact("Holisticon Craftsmen", "https://www.holisticon.de", "[email protected]"),
// "Revised BSD License", "https://github.com/holisticon/ranked/blob/master/LICENSE.txt"))
Contact is no longer valid at that point
somehow, the sets are evaluated after the disjunct validation, which leads to NPE in the disjunct function
java.lang.NullPointerException: null
at de.holisticon.ranked.command.api.CreateMatch$$EQbwrayu.disjunct(Commands.kt:53) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
at org.springsource.loaded.ri.ReloadedTypeInvoker$2.invoke(ReloadedTypeInvoker.java:133) ~[springloaded-1.2.8.RELEASE.jar:1.2.8.RELEASE]
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1462) ~[springloaded-1.2.8.RELEASE.jar:1.2.8.RELEASE]
at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:120) ~[spring-expression-5.0.1.RELEASE.jar:5.0.1.RELEASE]
The update to kotlin 1.2.20 caused the bean validation test failed because the validation properties where not loaded from main/resources.
To temporarily fix this, the file was duplicated with 495b2ab
This should be removed again and fixed in a correct way.
Idea: maybe accessing resources in test/surefire changed?
E.g. navigate back to the last played set?
the maven modules should reflect the architecture, so let's move everything backend related to /backend and everything frontend related to /frontend
we can already start the applications via docker-compose, but we also want to build the docker images via maven.
After a small discussion with @jangalinski we identified the following problem. A system configuration provided by properties file (application.yml) should not change the system behavior. In general this is a problem, because the properties are exactly made for this: change the behaviour of the application. Having no "current" state in the application makes it difficult to handle. Here is an example:
Imagine we configure the property of number of sets to win a set to 6. The matches created with this value are validated against this number and the corresponding events are stored. If this number changes (because we consider the new rules and play till 10), the events created with value 6 become invalid.
To handle this issue, ths configration must be held inside of an aggregate. A config change should be considered as a system command, and the aggregate may reject it, or send the corresponding events to the components.
POST to
http://localhost:8081/command/createMatch
(TODO: rename to /match)
to trigger axon creation of a match
eat your own dogfood
update plugin version to latest
replace the current spring boot parent with
<groupId>io.toolisticon.maven</groupId>
<artifactId>maven-oss-parent</artifactId>
<version>0.4</version>
<relativePath />
it really looks as if the replay (stop/delete token/start) does not work as expected ...
elo and user are have service characteristics, so they should be implemented inside their own modules.
Note: don't forget to mention this in the readme!
2017-12-08 12:15:48.447 ERROR 61656 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Eindeutiger Index oder Primärschlüssel verletzt: "UK8S1F994P4LA2IPB13ME2XQM1W_INDEX_8 ON PUBLIC.DOMAIN_EVENT_ENTRY(AGGREGATE_IDENTIFIER, SEQUENCE_NUMBER) VALUES ('kermit', 0, 1)"
Unique index or primary key violation: "UK8S1F994P4LA2IPB13ME2XQM1W_INDEX_8 ON PUBLIC.DOMAIN_EVENT_ENTRY(AGGREGATE_IDENTIFIER, SEQUENCE_NUMBER) VALUES ('kermit', 0, 1)"; SQL statement:
insert into domain_event_entry (event_identifier, meta_data, payload, payload_revision, payload_type, time_stamp, aggregate_identifier, sequence_number, type, global_index) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-196]
2017-12-
Provide some instructions how to start frontend (URL?)
Validation of data is an important step towards prevention of errors and it should be executed as early as possible in the system. We use JSR330 Bean Validation to prevent wrong data from being entered into the system and put most of the data inside of the model classes, event classes and command classes.
Aparently, we have to be careful with validation constraints defined on the domain types, and separate them from rules defined through the domain aggregate logic.
Type constraints should be independent of the domain state and configuration - example, the score (=number of goals shot in the match) is a positive number or zero.
Domain constraints have a semantical meaning and may depend on domain configuration - example, the score to win a match at holisticon soccer is 6. It is wrong to put the validation of the score == 6 into domain type, because it is defined inside of our bounded context == aggregate, and is not defined in the domain.
P.S. if someone wants to define it inside the domain, it should be not ScoreToMinMatchSet, but something like HolisticonScoreToWinMatchSet - which makes a naming different and would be probably a bad domain type.
patch release is out
I see this
[WARNING] ...\ranked\command\src\main\kotlin\Configuration.kt: (47, 39) This class shouldn't be used in Kotlin. Use kotlin.Int instead.
[WARNING] ...\ranked\command\src\main\kotlin\Configuration.kt: (50, 41) This class shouldn't be used in Kotlin. Use kotlin.Int instead.
[WARNING] ...\ranked\command\src\main\kotlin\Configuration.kt: (53, 36) This class shouldn't be used in Kotlin. Use kotlin.Int instead.
[WARNING] ...\ranked\command\src\main\kotlin\Rest.kt: (32, 11) Variable 'result' is never used
[WARNING] ...\ranked\command\src\main\kotlin\aggregate\Player.kt: (30, 36) This class shouldn't be used in Kotlin. Use kotlin.Int instead.
switch to BeanPostProcessor instead of manual scanning for annotated classes.
I saw on shutdown:
2017-11-10 22:15:04.375 INFO 50591 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : testdb - Shutdown initiated...
2017-11-10 22:15:04.388 INFO 50591 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : testdb - Shutdown completed.
testdb is the default in-mem db name, but we do not use it, we use localhost:9092/mem:ranked .
so why do we have testdb, how can we get rid of it, and is hikari (pooling) also used/usable for our tcp-db?
Seems like a technical iOS issue. When selecting the players for team red, the selection is upside down (like the player icons). In this situation the scroll on iOS is wrong, because it isn't rotated.
Although we already use wait for dependencies ( https://github.com/dadarek/docker-wait-for-dependencies), we still got the problem, that the backend tries to communicate with the db before its ready. This results in connection exceptions on startup.
We should either fix this or at least deal with the exceptions.
Warning in spring-boot start:
2017-12-08 10:34:55.016 WARN 57594 --- [ost-startStop-1] o.s.h.c.j.Jackson2ObjectMapperBuilder : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
at least for the h2-app it would be nice to use rest-jpa repos and have them in swagger as well ... this is supposed to work wie springfox 2.7 but fails with spring boot 2 (so far)
In order to enable better evaluation, it is reasonable to collect timestamps of game start and all goals shot.
User should be able to switch attack and defense player within a team when playing the third set of a match.
Currently Match Winning is an artificial construct to learn Sagas, but it feels like a smell, because it moves the logic of Match winning out of the match.
A better approach might be to calculate the match result inside of the Match Aggregate.
In the file frontend/src/main/js/pages:sendResults()
I am sending the following POST to http://localhost:8080/command/match
:
{ "teamRed":{ "player1":{ "value":"danielsteinhoefer" }, "player2":{ "value":"detlefvonderthuesen" } }, "teamBlue":{ "player1":{ "value":"lukastaake" }, "player2":{ "value":"leonfausten" } }, "matchSets":[ { "goalsRed":6, "goalsBlue":0, "offenseRed":{ "value":"danielsteinhoefer" }, "offenseBlue":{ "value":"lukastaake" } }, { "goalsRed":0, "goalsBlue":6, "offenseRed":{ "value":"detlefvonderthuesen" }, "offenseBlue":{ "value":"leonfausten" } } ], "type":"result" }
Unfortunately the validation fails with the following console output:
2018-01-26 16:11:48.431 WARN 65859 --- [nio-8081-exec-5] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Missing type id when trying to resolve subtype of [simple type, class de.holisticon.ranked.model.AbstractMatchSet]: missing type id property 'type' (for POJO property 'matchSets'); nested exception is com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class de.holisticon.ranked.model.AbstractMatchSet]: missing type id property 'type' (for POJO property 'matchSets') at [Source: (PushbackInputStream); line: 1, column: 298] (through reference chain: de.holisticon.ranked.command.api.CreateMatch["matchSets"]->java.util.ArrayList[0])
somehow the classloading changed, we get test failures for bean validation because validation messages are not resolved.
With kotlin 1.2.10 this still works.
see also: #45
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.