Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xxlabaza/future-service


https://github.com/xxlabaza/future-service

Last synced: 14 days ago
JSON representation

Awesome Lists containing this project

README

        

# Overview

This is a simple service for playing in the AWS ecosystem.

The service provides functionality for submitting an HTTP request to a remote service, which invokes once (in spite of the submits maybe several times), its response caches, and resend to a specified destination(s) (optional).


POST /


Submits a new HTTP request. JSON payload explanation:


keydescriptiondefault 


reqeust
an object, which describes an HTTP request
-
required


    url
request's URL
-
required


    method
HTTP method
GET
optional


    headers
the headers of the reqeust
-
optional


    body
request's payload
-
optional


sendTo
an object describes where to send request's response
-
optional


    url
URL where send the response
-
optional


    method
HTTP method
GET
optional


    headers
the headers of the reqeust
-
optional


    includeResponseHeaders
a flag, which indecates - true if original response headers should be copied, false otherwise
true
optional


A request body example:

{
"request": {
"url": "http://localhost:8989",
"method": "delete",
"headers": {
"Key1": "Value1",
"Key2": ["Value2", "Value3"]
},
"body": "Hello world"
},
"sendTo": {
"url": "localhost:9999/api",
"includeResponseHeaders": false
}
}


## Build docker image

```bash
$> ./mvnw clean package docker:build
```

## Package, verify and run

```bash
$> ./mvnw clean package verify; and java -jar target/future-service-1.1.1.jar
```