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

add self define config #4260

Conversation

gy09535
Copy link
Contributor

@gy09535 gy09535 commented Mar 10, 2022

Which issue(s) this PR fixes:

Fixes #4259

Brief changelog

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

@github-actions
Copy link

github-actions bot commented Mar 10, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@gy09535
Copy link
Contributor Author

gy09535 commented Mar 10, 2022

I have read the CLA Document and I hereby sign the CLA

@gy09535
Copy link
Contributor Author

gy09535 commented Mar 10, 2022

recheck

@nobodyiam
Copy link
Member

It looks like self define discovery is very similar to KubernetesDiscoveryService, could we just reuse that instead?

@gy09535
Copy link
Contributor Author

gy09535 commented Mar 11, 2022

It looks like self define discovery is very similar to KubernetesDiscoveryService, could we just reuse that instead?

Functionally speaking, it is similar, but semantically it is different, k8s definition is through k8s service discovery to replace eureka, but in some non-k8s environments or complex deployment scenarios, we do not need to use k8s services as service discovery, then we need more flexible semantics to define this operation, if we use k8s service discovery, can cause semantic mixing, conceptually unclear.

@nobodyiam
Copy link
Member

nobodyiam commented Mar 12, 2022

Then I suppose we could do like this, in which custom-defined is the profile to be activated for those non-kubernetes environment, but we could share the same implementation.

@Service
@Profile({"kubernetes", "custom-defined-discovery"})
public class KubernetesDiscoveryService implements DiscoveryService {
}

@gy09535
Copy link
Contributor Author

gy09535 commented Mar 14, 2022

Then I suppose we could do like this, in which custom-defined is the profile to be activated for those non-kubernetes environment, but we could share the same implementation.

@Service
@Profile({"kubernetes", "custom-defined-discovery"})
public class KubernetesDiscoveryService implements DiscoveryService {
}

Good idea 👍

@gy09535 gy09535 closed this Mar 14, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add self define meta server
2 participants