-
Notifications
You must be signed in to change notification settings - Fork 927
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
Add Dropwizard module #2236
Add Dropwizard module #2236
Conversation
Whoa. This is awesome! Let me review some time tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
examples/dropwizard-bundle/src/main/java/example/dropwizard/DropwizardArmeriaApplication.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
Master builds failing?
|
That is weird. Build passes at master. Let me check what is happening in this branch. |
My guess is that |
Am seeing this Exception when running my example module with common AccessLogWriter
|
Codecov Report
@@ Coverage Diff @@
## master #2236 +/- ##
============================================
+ Coverage 73.69% 73.83% +0.13%
- Complexity 10324 10430 +106
============================================
Files 895 910 +15
Lines 39405 39689 +284
Branches 4890 4902 +12
============================================
+ Hits 29041 29303 +262
- Misses 7882 7893 +11
- Partials 2482 2493 +11
Continue to review full report at Codecov.
|
Doh! Let me send a fix PR for that. |
Oops, that was recently introduced by me. #2159 😅 |
Now getting NoSuchMethodError related to the Guava relocation.
|
Ah, we need to exclude dropwizard packages for |
@Cricket007 A little bit more complicated than imagined, but here's the fix: diff --git dropwizard/build.gradle dropwizard/build.gradle
index 099afb9a2..12dfd7bd9 100644
--- dropwizard/build.gradle
+++ dropwizard/build.gradle
@@ -1,3 +1,12 @@
+buildscript {
+ repositories {
+ gradlePluginPortal()
+ }
+ dependencies {
+ classpath "com.github.jengelman.gradle.plugins:shadow:${managedVersions['com.github.jengelman.gradle.plugins:shadow']}"
+ }
+}
+
dependencies {
compile project(':jetty')
// Dropwizard
@@ -9,3 +18,16 @@ dependencies {
testCompile 'io.dropwizard:dropwizard-testing'
}
+
+// Do not relocate Guava because it's part of Dropwizard's public API.
+[tasks.shadedJar, tasks.shadedTestJar].each { task ->
+ task.relocators.clear()
+ project.ext.relocations.each { Map<String, String> props ->
+ def from = props['from']
+ def to = props['to']
+ if (from in ['com.google.common', 'com.google.thirdparty.publicsuffix']) {
+ return
+ }
+ task.relocate from, to
+ }
+} |
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
...s/dropwizard-bundle/src/main/java/example/dropwizard/armeria/services/http/HelloService.java
Outdated
Show resolved
Hide resolved
...s/dropwizard-bundle/src/main/java/example/dropwizard/armeria/services/http/HelloService.java
Outdated
Show resolved
Hide resolved
...s/dropwizard-bundle/src/main/java/example/dropwizard/armeria/services/http/HelloService.java
Outdated
Show resolved
Hide resolved
...s/dropwizard-bundle/src/main/java/example/dropwizard/armeria/services/http/HelloService.java
Outdated
Show resolved
Hide resolved
...com/linecorp/armeria/server/dropwizard/connector/proxy/ArmeriaHttpProxyConnectorFactory.java
Outdated
Show resolved
Hide resolved
...ava/com/linecorp/armeria/server/dropwizard/connector/proxy/ArmeriaProxyConnectorFactory.java
Outdated
Show resolved
Hide resolved
...wizard/src/test/java/com/linecorp/armeria/server/dropwizard/ArmeriaConnectorFactoryTest.java
Outdated
Show resolved
Hide resolved
I'm still looking into fixing the |
The |
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaBundle.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
...com/linecorp/armeria/server/dropwizard/connector/proxy/ArmeriaHttpProxyConnectorFactory.java
Outdated
Show resolved
Hide resolved
...ava/com/linecorp/armeria/server/dropwizard/connector/proxy/ArmeriaProxyConnectorFactory.java
Outdated
Show resolved
Hide resolved
...wizard/src/test/java/com/linecorp/armeria/server/dropwizard/ArmeriaConnectorFactoryTest.java
Outdated
Show resolved
Hide resolved
dropwizard/src/test/resources/yaml/server/https-server-minimal.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits.
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
...d/src/main/java/com/linecorp/armeria/server/dropwizard/connector/ArmeriaServerDecorator.java
Outdated
Show resolved
Hide resolved
dropwizard/src/main/java/com/linecorp/armeria/server/dropwizard/ArmeriaServerFactory.java
Outdated
Show resolved
Hide resolved
examples/dropwizard/src/main/java/example/dropwizard/DropwizardArmeriaApplication.java
Show resolved
Hide resolved
Didn't have a chance to look into the error yet. Will try this week. 🙇♂️ |
Signed-off-by: Jordan Moore <[email protected]>
Signed-off-by: Jordan Moore <[email protected]>
Signed-off-by: Jordan Moore <[email protected]>
Signed-off-by: Jordan Moore <[email protected]>
Signed-off-by: Jordan Moore <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, @Cricket007. You did an excellent work!
dropwizard/src/test/java/com/linecorp/armeria/dropwizard/ArmeriaServerFactoryTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a million! You did a great job! 👍
Thanks again, everyone! |
🎉🎉🎉 Thanks, @Cricket007! |
Motivation: Armeria's Spring Boot auto configure moduleffers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different. Sometimes it may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to * ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and * `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry` * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Armeria's Spring Boot auto configure moduleffers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different. Sometimes it may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to * ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and * `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry` * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Armeria's Spring Boot auto configure moduleffers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different. Sometimes it may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to * ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and * `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry` * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Armeria's Spring Boot auto configure moduleffers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different. Sometimes it may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to * ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and * `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry` * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Armeria's Spring Boot auto configure moduleffers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different. Sometimes it may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to * ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and * `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry` * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Armeria's Spring Boot auto configure moduleffers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different. Sometimes it may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to * ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and * `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry` * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Armeria's Spring Boot auto configure module offers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different. Sometimes it may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to * ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry` * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Armeria's Spring Boot auto configure module offers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by #2236. It can also customize Armeria Server from YAML. But the configuration style is different between Spring Boot and Dropwizard. The user should learn how to configure Armeria in each module. It may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry`. * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Motivation: Dropwizard is another popular framework we'd like to integrate Armeria into. Modifications: - Add `armeria-dropwizard` which provides a Dropwizard bundle and SPI implementations. - Add documentation about Dropwizard integration - Add an example Result: Closes line#2165
Motivation: Armeria's Spring Boot auto configure module offers to customize the Armeria server from JSON YAML. Dropwizard module has been added to Armeria by line#2236. It can also customize Armeria Server from YAML. But the configuration style is different between Spring Boot and Dropwizard. The user should learn how to configure Armeria in each module. It may confuse the user. Modification: * Apply Spring Boot's YAML convention to the Dropwizard module. * Add ArmeriaConfigurationUtil for applying ArmeriaSettings to ServerBuilder. * Copy `CustomAliasKeyManagerFactory` and `CustomAliasX509ExtendedKeyManager` from `amreria/spring/boot-autoconfigure` to configure TLS fluenltly. * Add meter exporsition for `DropwizardMeterRegistry`. * Remove unused configuration files. Result: Provide a consistent configuration to Armeria Dropwizard.
Adding module for dropwizard integration
Why
Progress
Closes #2165