-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat database new #273
Feat database new #273
Conversation
Comments and documentation follow tomorrow. Reply handling is still an issue.
Current error message to commit 45fc7b0:
Problem is MongoDB answers a |
Maybe something like this in JacksonCodec is needed:
You can tell Jackson to ignore such properties on a global level by disabling a deserialization feature as follows:
Alternatively, you can use the following annotation on the class to ignore unknown properties.
|
I just looked over your code and a question arose: Are these D2-specific code sections for testing purposes? Because if not so, we have to find a way to outsource them somehow.
I think I would like this solution with an annotation. You don't change the behaviour on a global level but get it working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks quite promising. However I would like to see the D2-parts gone before merging it, ok? :)
Good. Before merging, i just want to fix the request-reply issue. I couldn't find a working solution for this yet. |
Do you have an idea where to put the annotation? |
It looks like he wants to map the received reply from the database, back to the Java-Record @cb0s @jvpichowski do you know if the replied JsonObject must have the same structure as the requested JsonObject sent by vertx.eventbus().request(...)? The problem with the |
I think i found the source of the thrown Exception. In the
Seems like for jackson to work properly it has to know the added key to the JsonObject pre conversion. @jvpichowski @cb0s do you have any idea how to solve this issue? In principle the DbRequest.query() should accept any key/value-pair, because that's how queries in MongoDB work. |
KISS principle does its job
With the recent commit 5a54ed3 i switched the implementation of |
DataListener now directly sends to MongoDatabaseService.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me so far.
private static record Configuration(@JsonProperty JsonObject dbConfig, @JsonProperty String dbPoolName) { | ||
private Configuration() { | ||
this(new JsonObject().put("db_name", "raketenpraktikum").put("useObjectId", true), "raketenpraktikumPool"); | ||
this(new JsonObject().put("db_name", "daedalus2").put("useObjectId", true), "d2Pool"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason why you have daedalus2 in the private constructor? Not that it really matters, however for keeping this repository "client-free" you maybe could consider to unit the Configuration with null
values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right. That still comes from my perception, that the private constructor is used, when no values are specified.
I just moved the currently working database implementation from the daedalus2-project back to telestion-core. |
Do it if there are no D2 dependencies. :) |
I cannot merge by myself, because merging is blocked and can only be performed automatically with 1 approving review. @jvpichowski |
Closing, because code now resides in https://github.com/wuespace/telestion-extension-mongodb. |
Summary
Improvements to the current database implementation.
Details
Add implementation for querying data periodically from db.
Supply an example for project specific usage.
Additional information
There is a problem between PeriodicDataPublisher.java and MongoDatabaseService.java, when handling the reply message from the database to the publisher. I assume the problem is coming from a faulty usage of the JacksonCodec.
CLA