generator-jhipster icon indicating copy to clipboard operation
generator-jhipster copied to clipboard

Switch to Consul as default service discovery mechanism

Open deepu105 opened this issue 2 years ago • 8 comments

Since eureka is kind of unmaintained and JHipster registry is deprecated and JHCC is unmaintained, it makes sense to make Consul the default service discovery mechanism in JHipster.

  • [x] Change default in generator
  • [x] Change default in JDL
  • [ ] update docs at hipster.tech
  • [x] Test docker compose and kubernetes setup
  • [x] Update conul kubernetes setup to latest version
  • [ ] Update JHipster Online: https://github.com/jhipster/jhipster-online -> https://start.jhipster.tech/generate-application
  • [ ] Update Sample JDL: https://github.com/jhipster/jdl-samples
  • [ ] Update Sample Apps: https://github.com/jhipster/jhipster-sample-app-gateway and https://github.com/jhipster/jhipster-sample-app-microservice
  • [ ] Check and update JHipster Base: https://github.com/jhipster/jhipster-base
  • [ ] Probably IDE too: https://github.com/jhipster/jhipster-ide

deepu105 avatar Jul 08 '22 11:07 deepu105

Agree with this change

pascalgrimaud avatar Jul 08 '22 12:07 pascalgrimaud

It's a bit sad to replace Eureka by a proprietary solution that offers a very expensive Enterprise version. Personally, I think that Spring Cloud Zookeeper would have been a nicer solution.

gmarziou avatar Aug 02 '22 18:08 gmarziou

@gmarziou for the moment, its imporatnt to provide a stable option as default. I'm also not happy with providing Consul as default but unless we implement a replacement with Spring Cloud Zookeeper or something we should provide Consul as default. We can switch it back when we have something as replacement. WDYT?

deepu105 avatar Aug 10 '22 12:08 deepu105

@gmarziou i'm not very familiar with zookeeper, do you think we can replace Eureka with Spring cloud zookeeper for JH Registry? if so can you create a ticket with some details so we can put a bounty on it and if it gets done before v8, we can make that the default

deepu105 avatar Aug 10 '22 12:08 deepu105

Consul as a short term solution is perfect.

I don't have any experience with Zookeeper itself, I only know about it through other tools like Kafka. Few 3rd party UI projects exist for it. Hazelcast can use it.

So, on paper, it looks like a good Eureka replacement. But at same time, when I look at the git repos of jhipster-registry and jhipster-control-center, it seems that they are abandoned.

So maybe the right approach is to integrate only the discovery client and forget about providing a server and consider that service discovery should be done by the infra structure (Consul, Kubernetes, AWS, Azure, ...).

The cool thing about Consul and Zookeeper is that we don't need a cloud account to run a microservices architecture, we can just run them locally using docker-compose.

gmarziou avatar Aug 10 '22 23:08 gmarziou

@gmarziou yes thats the main reason why I proposed making consul the default. JHipster registry can still be used (but IMO we should remove it as its unmaintained, maybe by offering a zookeeper version or something) so are you ok to proceed with this change (making consul default) for v8?

deepu105 avatar Aug 11 '22 12:08 deepu105

It's possible to drop consul-loader docker image?

mshima avatar Aug 11 '22 12:08 mshima

@mshima not at the moment as its used to load the shared configuration for the microservices. If we drop it, we need to find an alternative for that

deepu105 avatar Aug 11 '22 12:08 deepu105

increased the bounty as its way too much work

deepu105 avatar Feb 14 '23 11:02 deepu105

Since consul is the default, would be nice to have m1 support at consul-loader. I tried to update consul loader, but the dependencies are unmaintained for a long time.

mshima avatar Mar 14 '23 12:03 mshima

Could you explain what you mean by m1 support?

On Tue, 14 Mar 2023, 13:15 Marcelo Shima, @.***> wrote:

Since consul is the default, would be nice to have m1 support at consul-loader. I tried to update consul loader, but the dependencies are unmaintained for a long time.

— Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/19109#issuecomment-1467997647, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF6CY7HNGOWWARDN2VTW4BONXANCNFSM53AXRPIA . You are receiving this because you were assigned.Message ID: @.***>

deepu105 avatar Mar 14 '23 21:03 deepu105

Sorry. Apple silicon (m1). consul-loader image runs in compat mode.

mshima avatar Mar 17 '23 16:03 mshima

I'm not familiar with macs. But what does it do when it runs in that mode. Does it matter in development? Coz I guess no one is gonna run production on macs right?

On Fri, 17 Mar 2023, 17:00 Marcelo Shima, @.***> wrote:

Sorry. Apple silicon (m1). consul-loader image runs in compat mode.

— Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/19109#issuecomment-1474057643, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF5EUW2RLUFLZCCQD3DW4SDCDANCNFSM53AXRPIA . You are receiving this because you were assigned.Message ID: @.***>

deepu105 avatar Mar 17 '23 19:03 deepu105

@colameo I don't see anything to update in JHipster IDE for this. Let me know if you think otherwise

deepu105 avatar Aug 19 '23 10:08 deepu105

bounty claimed (after a year :rofl: ) https://opencollective.com/generator-jhipster/expenses/156618

deepu105 avatar Aug 19 '23 11:08 deepu105

@deepu105 : approved. Can this ticket be closed?

pascalgrimaud avatar Aug 19 '23 11:08 pascalgrimaud

@pascalgrimaud thanks. i'll close it once the docs PRis merged

deepu105 avatar Aug 19 '23 11:08 deepu105