整体开发过程:前后端分离
[可选]nginx处理:静态文件,反代请求,负载均衡,ddos防护,cros,https
部署:单机部署(集群)
- deploy service verticle name:packageName + Verticle
- service:
- use
serviceImplFactory
to create a serviceImpl. - proxy service
- deploy serviceRestApiVerticle
- createHttpServer
- publishHttpEndpoint
- use
- name:
- service api with
SERVICE_NAME = "$service-rest-api
field
- service api with
- openjdk 13+
- PostgreSQL 11.x
in root project:
- startAll: stop all running verticles and start all verticles in background(need add
-Dcmd=start
inArguments
) - list: execute common:list task
- stop: execute common:stop task
- clean: delete
build
andlog
dir
in pers.z950.codegen project:
- gen: generate
EBProxy
andProxyHandler
file, for service proxy
in common project:
- list: list running verticles
- stop: stop all running verticles
notice:
run
task will run under idea, sostop
andlist
task cant work, but application can work normally.
in others sub project:
- run: run the main verticle use common.Launcher.
- switch: cmd
- run: default. run verticle frontend, only in this switch we can debug with breakpoint
- start: run verticle background
- switch: cmd
- shadowJar: make shadowJar
- runJar: run jar in cmd
- code generate
- choose
backend:codegen
gradle project - choose
run
task - press
Run
button
- choose
- start verticle
- choose
backend:$subproject
gradle project (e.g.backend:gateway
) - choose
run
task (with default switch-Dcmd=start
) - press
Run
orDebug
button
- choose
// todo
- running in hazelcast cluster (vertx plugin)
- after reducing permissions, need restart the service
- hazelcast
- [WARNING: Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages.]
- [WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer to field sun.nio.ch.SelectorImpl.selectedKeys]