This bundle enables one to build downstream proxy with support for transparent callbacks and durable mailbox with polling support. This bundle compiles only on Java 8.
- Honours Accept header for common media types (JSON, XML, MsgPack)
- Polling for status of requests
- Durability of requests/responses
- Pluggable persistence provider for requests/responses
Build a downstream proxy with ease that enables transparent callback support
-
Clone the source:
git clone github.com/phaneesh/revolver
-
Build
mvn install
Use the following repository:
<repository>
<id>clojars</id>
<name>Clojars repository</name>
<url>https://clojars.org/repo</url>
</repository>
Use the following maven dependency:
<dependency>
<groupId>io.dropwizard.revolver</groupId>
<artifactId>dropwizard-revolver</artifactId>
<version>1.3.7-18-SNAPSHOT</version>
</dependency>
@Override
public void initialize(Bootstrap<ApiConfiguration> bootstrap) {
bootstrap.addBundle(new RevolverBundle<ApiConfiguration>() {
@Override
public RevolverConfig getRevolverConfig(ApiConfiguration apiConfiguration) {
return apiConfiguration.getRevolver();
}
@Override
public PersistenceProvider getPersistenceProvider() {
return new InMemoryPersistenceProvider();
}
});
revolver:
clientConfig:
clientName: revolver-api
services:
- type: http
service: mocky
connectionPoolSize: 5
connectionKeepAliveInMillis: 60000
authEnabled: false
endpoint:
type: simple
host: www.mocky.io
port: 80
threadPoolGroupConfig:
threadPools:
- threadPoolName: group1-thread-pool
concurrency: 5
maxRequestQueueSize: 10
- threadPoolName: group2-thread-pool
concurrency: 5
maxRequestQueueSize: 10
apis:
- api: ping
async: false
path: "{version}/56da42e80f0000ac31a427ce"
whitelist: true #Optional metadata for external authentication & authorization systems. Omitting the config will not effect behaviour.
methods:
- GET
authorization: #Optional metadata for external authorization systems. Omitting the config will not effect behaviour
type: dynamic #can
methods:
- GET
roles:
- user
runtime:
threadPool:
concurrency: 5
timeout: 10000
- api: pong
async: false
path: "{version}/56da42e80f0000ac31a427ce"
whitelist: true #Optional metadata for external authentication & authorization systems. Omitting the config will not effect behaviour.
methods:
- GET
authorization: #Optional metadata for external authorization systems. Omitting the config will not effect behaviour
type: dynamic #can
methods:
- GET
roles:
- user
runtime:
threadPool:
timeout: 10000
groupThreadPool:
enabled: true
name: group1-thread-pool
- api: retryer
async: false
path: "{version}/retry"
whitelist: true #Optional metadata for external authentication & authorization systems. Omitting the config will not effect behaviour.
methods:
- GET
authorization: #Optional metadata for external authorization systems. Omitting the config will not effect behaviour
type: dynamic #can
methods:
- GET
roles:
- user
runtime:
threadPool:
timeout: 10000
retryConfig:
enabled: true
maxRetry: 3
- @phaneeshn
- Shailesh Satarkar - UI/UX Ninja
- Nitish Goyal
Copyright 2016 Phaneesh Nagaraja [email protected].
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.