jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.53k stars 4.02k forks source link

Jhipster v8.1.0 asks to generate Feign client during Monolithic app creation #24560

Closed cfreyer closed 10 months ago

cfreyer commented 10 months ago
Overview of the issue

While running jhipster to create a new project, a user can choose both a Monolithic application, and a Feign client. After answering remaining questions, project generation fails with the following error:

ERROR! An error occured while running jhipster:server#feignMigration ERROR! ERROR! Feign client is only supported by microservice applications.

Motivation for or Use Case

Completing the questions to generate a new app should not lead to a failure situation.

Reproduce the error

install JHipster v8.1.0. Answer questions as follows: What is the base name of your application? something ? Which type of application would you like to create? Monolithic application (recommended for simple projects) ? Do you want to generate a feign client? Yes ? Besides Junit, which testing frameworks would you like to use? Cucumber ? Do you want to make it reactive with Spring WebFlux? No ? What is your default Java package name? com.test ? Which type of authentication would you like to use? JWT authentication (stateless, with a token) ? Which type of database would you like to use? SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL) ? Which production database would you like to use? PostgreSQL ? Which development database would you like to use? H2 with in-memory persistence ? Which cache do you want to use? (Spring cache abstraction) No cache - Warning, when using an SQL database, this will disable the Hibernate 2nd level cache! ? Would you like to use Maven or Gradle for building the backend? Maven ? Which other technologies would you like to use? API first development using OpenAPI-generator

Related issues
Suggest a Fix

Bypass feign client question if user selects Monolithic in previous question

JHipster Version(s)

v8.1.0

JHipster configuration

Welcome to JHipster v8.1.0 Welcome to the JHipster Information Sub-Generator

/home/me/code/test
└── (empty)
JHipster configuration not found
Environment and Tools

openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment GraalVM CE 17.0.9+9.1 (build 17.0.9+9-jvmci-23.0-b22) OpenJDK 64-Bit Server VM GraalVM CE 17.0.9+9.1 (build 17.0.9+9-jvmci-23.0-b22, mixed mode, sharing)

git version 2.39.2

node: v18.18.2 npm: 10.2.5

Docker version 24.0.7, build afdd53b WARNING! Current location doesn't contain a valid JHipster application


no jdl yet

Entity configuration(s) entityName.json files generated in the .jhipster directory

no entity file yet

Browsers and Operating System

No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm

Linux pluto 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux

mraible commented 10 months ago

I experienced this tonight when updating my jhipster8-demo. This has never been a question before when creating monoliths, so it's a regression.

atomfrede commented 10 months ago

It was added via https://github.com/jhipster/generator-jhipster/pull/24457

nil-malh commented 10 months ago

Hi there, is anyone working on this ? I will be happy to try and fix it !

atomfrede commented 10 months ago

@nil-malh If you like go ahead. If you have any question don't hesitate to ask.

nil-malh commented 10 months ago

Okay gonna work on it today will keep you posted !

nil-malh commented 10 months ago

@atomfrede Do we agree that the expected behavior is the following ?

atomfrede commented 10 months ago

Not sure, maybe have it for microservices and gateways, by default it should be false and not shown for monolith. @mshima what do you say? Did I miss something such that we want feign clients for monolith too?

nil-malh commented 10 months ago

Not sure, maybe have it for microservices and gateways, by default it should be false and not shown for monolith. @mshima what do you say? Did I miss something such that we want feign clients for monolith too?

I would assume no, there is an error implemented that will throw if the app is a monolith and asked for a feign client

nil-malh commented 10 months ago

Fixed in #24566

cfreyer commented 10 months ago

For what it's worth:

A) I have not seen the feign client option in the past when generating a monolithic application.

B) Technically, if the monolith's API is exposed, a developer could use the feign client when writing another backend. However, I think this goes beyond the expectations of a monolith application.

On Thu, Dec 14, 2023 at 8:11 AM Frederik Hahne @.***> wrote:

Not sure, maybe have it for microservices and gateways, by default it should be false and not shown for monolith. @mshima https://github.com/mshima what do you say? Did I miss something such that we want feign clients for monolith too?

— Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/24560#issuecomment-1855826418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKMG63B3KZ7N23CHQ7SSJLYJL3IXAVCNFSM6AAAAABAUD5ENCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJVHAZDMNBRHA . You are receiving this because you authored the thread.Message ID: @.***>

mraible commented 10 months ago

I have not seen this question before when generating a gateway or microservice either. I'm not sure it should be an option for gateways since we only support Spring Cloud Gateway with WebFlux right now, which often uses WebClient instead of OpenFeign.

Spring Cloud Gateway does support Spring MVC now, but I found you can't configure its token relay filter in YAML. It has to be configured in Java. This will be fixed in 2023.0.1.

https://github.com/spring-cloud/spring-cloud-gateway/issues/3176

nil-malh commented 10 months ago

@mraible what do you advice should I let it for gateways or only for microservices ?

mraible commented 10 months ago

I think it should only be for non-reactive microservices, but I'm not sure as I'm not familiar with when it was included in previous versions of JHipster.

nil-malh commented 10 months ago

Noted will do it now !

nil-malh commented 10 months ago

Done #24566

morobah commented 8 months ago

Hi everyone, I think the problem is still not fixed