Skip to content
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

Merged
merged 5 commits into from
Oct 3, 2023
Merged

Conversation

Nikita-Smirnov-Exactpro
Copy link
Member

No description provided.

@@ -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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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...

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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 {
Copy link
Member

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

@Nikita-Smirnov-Exactpro Nikita-Smirnov-Exactpro merged commit 54781d6 into dev-version-1 Oct 3, 2023
8 of 9 checks passed
@Nikita-Smirnov-Exactpro Nikita-Smirnov-Exactpro deleted the auto-book branch October 3, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants