lealone / Lealone

比 MySQL 和 MongoDB 快10倍的 OLTP 关系数据库和文档数据库
Other
2.45k stars 516 forks source link

能否增加使用vertx其他组件的示例 #164

Closed ContyChen closed 7 months ago

ContyChen commented 2 years ago

能否增加使用vertx其他组件的示例

codefollower commented 2 years ago

lealone-vertx 这个插件本身就已经在使用 vertx-web 了,如果你的应用需要用 vertx 的其他组件,直接在应用的 pom.xml 里加上就可以了。

然后可以写一个应用的 Router 继承 org.lealone.plugins.vertx.VertxRouter,就可以初始化 vertx 的其他组件。 可以直接参考 PetStoreRouter

codefollower commented 2 years ago

最快速的办法就是用 lealone 脚手架创建一个微服务应用,参考这里 比如创建了一个 hello 应用,把这个用 maven 管理的项目的代码直接导入到 eclipse 或 idea 中, 然后在 hello-web 那个模块的 pom.xml 中加入 vertx 的其他组件的依赖, 最后在 org.lealone.examples.hello.web.HelloRouter 类的 init 方法中初始化 vertx 的其他组件即可。