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

Microservice project cannot be created with websocket integration #7335

Closed
ramith opened this issue Mar 21, 2018 · 3 comments
Closed

Microservice project cannot be created with websocket integration #7335

ramith opened this issue Mar 21, 2018 · 3 comments
Milestone

Comments

@ramith
Copy link

ramith commented Mar 21, 2018

Overview of the issue

It seems command line wizard doesn't on include a option to have websockets configured in the project If I select the application type to be a micro service.

According to "https://stackoverflow.com/questions/40076535/jhipster-can-i-add-websocket-support-to-my-existing-generated-application"
I could should be able to change the .yo-rc.json by adding

"websocket":"spring-websocket"

and get it done. how ever,

yo jhipster

don't seem to care for this change and infact overwrites the .yo-rc.json by changing it back to

"websocket": false

Motivation for or Use Case

I find it quite useful to have a microservice communicate in websockets. I would tinker the app that is generated by manually adding the support it's messy.

Reproduce the error
  1. Generate a microservice app and observe that wizard don't ask to include web sockets (in its option list), nor give the option to include it from market place.
  2. Try to modify .yo-rc.json file as stated above and run 'yo jhipster'
Related issues

N/A

Suggest a Fix
  1. Include the option to have websockets in microservices project.
  2. lets not overwrite .yo-rc.json
JHipster Version(s)

v 4.14.1

JHipster configuration

Using JHipster version installed locally in current project's node_modules
Executing jhipster:info
Options:

JHipster Version(s)
gateway@0.0.0 E:\gateway
`-- generator-jhipster@4.14.1 

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "io.xiges.sample"
    },
    "jhipsterVersion": "4.14.1",
    "baseName": "gateway",
    "packageName": "io.xiges.sample",
    "packageFolder": "io/xiges/sample",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "replaced-by-jhipster-info",
    "enableTranslation": false,
    "applicationType": "microservice",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "clientPackageManager": "yarn",
    "skipClient": true,
    "skipUserManagement": true
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

git version 2.15.1.windows.2

node: v8.10.0

npm: 5.6.0

yeoman: 2.0.1

yarn: 1.5.1

Congratulations, JHipster execution is complete!

Browsers and Operating System

Windows 10

  • [X ] Checking this box is mandatory (this is just to show you read everything)
@jdubois
Copy link
Member

jdubois commented Mar 21, 2018

Yes this is on purpose, as our gateway does not support Websockets yet, as this is a limitation with Zuul 1. So we're not prompting for an option that would not make sense.

What people usually do is use Kafka between the gateway and the microservices, and then have only the gateway do websockets. It's much more stable (otherwise you need to chain the open sockets on several servers), and much more scalable (Kafka scales much better than a Websocket server), so it's also probably a better approach.

In the future, I sure hope we can propose this option, of course.

@jdubois jdubois closed this as completed Mar 21, 2018
@ramith
Copy link
Author

ramith commented Mar 22, 2018

Got it. thanks for the quick update.

@BhawaniSingh
Copy link
Member

@jdubois I think we can do websockets for microservices on our gateway in a way spring cloud gateway supports websockets. It filter out the websocket connection req, and then passes the connection to the underlying microservices. I'm not sure about it but can take a look into the spring cloud gateway

@jdubois jdubois added this to the 5.0.0-beta.0 milestone Apr 3, 2018
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

No branches or pull requests

3 participants