summaryrefslogtreecommitdiff
path: root/exampleSite/content/docs/dropwizard-configuration.md
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2018-09-30 01:31:24 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2018-09-30 01:31:24 +0200
commit5b7db23aaacbb08a8242b1a77bd39bc19139526c (patch)
treeb36f8ab16b89f1ae475db883f3f91b2a0a6837b8 /exampleSite/content/docs/dropwizard-configuration.md
parent7a6ab6d72496a07e42aa03242891b6d815b26b0d (diff)
Add exampleSite
Diffstat (limited to 'exampleSite/content/docs/dropwizard-configuration.md')
-rw-r--r--exampleSite/content/docs/dropwizard-configuration.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/exampleSite/content/docs/dropwizard-configuration.md b/exampleSite/content/docs/dropwizard-configuration.md
new file mode 100644
index 0000000..9bfdb70
--- /dev/null
+++ b/exampleSite/content/docs/dropwizard-configuration.md
@@ -0,0 +1,35 @@
+## Dropwizard configuration
+
+Use provided `RxJerseyBundle`
+```java
+@Override
+public void initialize(Bootstrap<RxJerseyConfiguration> bootstrap) {
+ bootstrap.addBundle(new RxJerseyBundle<RxJerseyConfiguration>()
+ .setClientConfigurationProvider(config -> config.client)
+ .register(HeaderInterceptor.class)
+ );
+}
+```
+
+Alternatively you can directly configure and register Jersey feature
+```java
+public void run(RxJerseyConfiguration configuration, Environment environment) throws Exception {
+ JerseyEnvironment jersey = environment.jersey();
+
+ Client client = new JerseyClientBuilder(environment)
+ .using(configuration.client)
+ .using(new GrizzlyConnectorProvider())
+ .buildRx("Client", RxObservableInvoker.class);
+
+ RxJerseyServerFeature rxJerseyServerFeature = new RxJerseyServerFeature()
+ .register(HeaderInterceptor.class);
+
+ RxJerseyClientFeature rxJerseyClientFeature = new RxJerseyClientFeature()
+ .register(client);
+
+ jersey.register(rxJerseyServerFeature);
+ jersey.register(rxJerseyClientFeature);
+}
+```
+
+#### [See example](https://github.com/alex-shpak/rx-jersey/tree/master/example) for more information \ No newline at end of file