-
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
Added auto book feature #2
Conversation
cradle-admin-tool-http/README.md
Outdated
@@ -29,6 +33,17 @@ spec: | |||
custom-config: | |||
ip: 198.168.0.2 | |||
port: 8080 | |||
auto-book: | |||
book1: | |||
book-creation-time: 2023-03-27T12:00:00 |
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.
I believe that we don't need to provide the ability to specify the exact time for a book. This is auto
functionality. So, I think it just should create a book with the current time (if the book does not exist).
A user always can call the endpoint to create a book with the time he or she needs.
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.
OK, it sound like correct but I think admin-tool should create book with time now - 1 hour and create a first page with the same date because schema can contain other active conns which can be started before admin-tool.
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.
Then maybe this is the problem in the schema. The cradle admin should be deployed before other components. Also, you always can create a book in the past using REST API in case there are events/messages from components that were deployed before cradle-admin...
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.
Then maybe this is the problem in the schema.
I don't think so, because by the th2 concept order of component starting doesn't matter.
REST API is complicated way when you need the simplest book to start work.
I try to solve start on a virgin machine
problem by this change.
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.
I don't think so, because by the th2 concept order of component starting doesn't matter.
We have a problem then because the order does matter)) What if the cradle-admin will be started after 1 hour + 1 second after the first component produces event/message? We still will have the problem that there is no book that matches the event/message time.
We don't make our and users' lives easier by saying let's just substruct an hour
or please, set the exact time you need for the book in config
. The only solution to the problem is to start cradle-admin before other components. Otherwise, we are doomed to face that potential problem again and again.
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.
Your statement is true when CR cradle-admin doesn't exist at the start environment moment or it has critical problem in configuration and user doesn't check environment.
In fact, user can have a problem event infra will start cradle-admin at first. We can solve part of problems when infra will find all book mentioned in schema and doesn't create estore / mstore queue until books have been created
import java.time.Instant; | ||
|
||
@SuppressWarnings("FieldMayBeFinal") | ||
public class AutoBookConfiguration { |
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.
You can use @JsonNaming
annotation on the class with PropertyNamingStrategies.KEBAB_CASE
...le-admin-tool-http/src/main/java/com/exactpro/th2/cradle/adm/http/AutoBookConfiguration.java
Outdated
Show resolved
Hide resolved
cradle-admin-tool-http/src/main/java/com/exactpro/th2/cradle/adm/http/AutoBookUtils.java
Outdated
Show resolved
Hide resolved
cradle-admin-tool-http/src/main/java/com/exactpro/th2/cradle/adm/http/AutoBookUtils.java
Outdated
Show resolved
Hide resolved
cradle-admin-tool-http/src/main/java/com/exactpro/th2/cradle/adm/http/PageManager.java
Outdated
Show resolved
Hide resolved
cradle-admin-tool-http/src/main/java/com/exactpro/th2/cradle/adm/http/PageManager.java
Outdated
Show resolved
Hide resolved
cradle-admin-tool-http/src/main/java/com/exactpro/th2/cradle/adm/http/Configuration.java
Outdated
Show resolved
Hide resolved
…dm/http/PageManager.java Co-authored-by: Oleg Smirnov <[email protected]>
No description provided.