如何创建我自己的自定义 Dropwizard 包?
How to create my own custom Dropwizard bundle?
文档中只有一条关于捆绑包的简短说明:
A Dropwizard bundle is a reusable group of functionality, used to define blocks of an application’s behavior.
仅此而已。我知道有称为 Bundle、ConfiguredBundle 和 ManagedBundle 的接口,但是既没有示例也没有教程如何使用这些接口。
有人可以举个例子吗?
可能与 Looking for a dropwizard
重复
Bundles are like addons to Dropwizard that make it very easy to add small pieces of functionality. For example, if you use the assets bundle, you can attach a UI to your API for testing purposes and it will run on the same port and is very easy to use. Another example would be the Migrations Bundle that easily ties Liquibase into Dropwizard so you can run database migrations with the same jar. This also works well since your API could be accessing some sql database which has connection parameters defined in a yml file, the migrations would be able to run on the same database.
我强烈建议查看 this git 存储库,那里有 2 或 3 个示例,可能会让您更好地了解什么是 Dropwizard 捆绑包。
文档中只有一条关于捆绑包的简短说明:
A Dropwizard bundle is a reusable group of functionality, used to define blocks of an application’s behavior.
仅此而已。我知道有称为 Bundle、ConfiguredBundle 和 ManagedBundle 的接口,但是既没有示例也没有教程如何使用这些接口。
有人可以举个例子吗?
可能与 Looking for a dropwizard
重复Bundles are like addons to Dropwizard that make it very easy to add small pieces of functionality. For example, if you use the assets bundle, you can attach a UI to your API for testing purposes and it will run on the same port and is very easy to use. Another example would be the Migrations Bundle that easily ties Liquibase into Dropwizard so you can run database migrations with the same jar. This also works well since your API could be accessing some sql database which has connection parameters defined in a yml file, the migrations would be able to run on the same database.
我强烈建议查看 this git 存储库,那里有 2 或 3 个示例,可能会让您更好地了解什么是 Dropwizard 捆绑包。