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

Introduces EurekaRegistrationFeature #9789

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ljnelson
Copy link
Member

@ljnelson ljnelson commented Feb 13, 2025

This PR introduces EurekaRegistrationFeature to implement the goals described in #9704.

Documentation will follow once the PR stabilizes.

@ljnelson ljnelson added enhancement New feature or request SE integration java Pull requests that update Java code 4.x Version 4.x labels Feb 13, 2025
@ljnelson ljnelson added this to the 4.2.0 milestone Feb 13, 2025
@ljnelson ljnelson self-assigned this Feb 13, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 13, 2025
@ljnelson ljnelson linked an issue Feb 13, 2025 that may be closed by this pull request
bom/pom.xml Show resolved Hide resolved
integrations/eureka/pom.xml Outdated Show resolved Hide resolved
integrations/eureka/pom.xml Show resolved Hide resolved
assumeTrue(System.getProperty("runTestAgainstEurekaServer", "false").equals("true"));
EurekaRegistrationFeature f = new EurekaRegistrationFeature();
f.afterStart(this.config, 8762, false);
Thread.sleep(40000); // 40 seconds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot have a test that sleeps for 40 seconds.
Also this test does not seem to assert anything - how do you check that something failed/worked?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to suggestions. This test relies on the presence of an external Eureka server (see the assumeTrue statement). It is run only manually. You need 40 seconds in such a case to test the 30-seconds-by-default lease expiration, and although Eureka has no documentation on this, various from-the-field reports suggest that bad things happen to the server if you drop this expiration time. What do you think I should do?

* @return {@code true} if the status change was successfully recorded for eventual registration or renewal; {@code
* false} if no action was taken
*/
public boolean markDown() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this public? There should be no user that can obtain an instance of a feature that is registered with the web server (there probably is, but it is not intended for users, features should only be used by webserver itself).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought was that a health check feature can (at least technically) get a collection of registered features and mark this down according to its own whims. I can remove these if you like. Let me know what to do.

* @return {@code true} if the status change was successfully recorded for eventual registration or renewal; {@code
* false} if no action was taken
*/
public boolean markUp() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as below - markDown

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See prior comment. Let me know what to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x enhancement New feature or request integration java Pull requests that update Java code OCA Verified All contributors have signed the Oracle Contributor Agreement. SE
Projects
Status: Sprint Scope
Development

Successfully merging this pull request may close these issues.

Add support for Eureka service registration
2 participants