https://github.com/canhnt/rest-proxy-service
This proxy service can receive long-term running jobs via its REST endpoint and forward to internal services
https://github.com/canhnt/rest-proxy-service
integration-services microservice producer-consumer spring-boot spring-security
Last synced: 8 months ago
JSON representation
This proxy service can receive long-term running jobs via its REST endpoint and forward to internal services
- Host: GitHub
- URL: https://github.com/canhnt/rest-proxy-service
- Owner: canhnt
- License: apache-2.0
- Created: 2018-04-06T21:34:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-06T21:47:12.000Z (over 7 years ago)
- Last Synced: 2024-12-29T03:28:01.527Z (9 months ago)
- Topics: integration-services, microservice, producer-consumer, spring-boot, spring-security
- Language: Java
- Size: 34.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# REST Proxy Service
This proxy service can receive long-term running jobs via its REST endpoint and forward to internal services.
Submitted jobs progresses can be retrieved via an API endpoint to check whether they complete.REST APIs are protected by user/password authentication and access tokens
## Build
#### Run in debug mode
```$xslt
mvn spring-boot:run
```#### Build distribution
```$xslt
mvn package
```
Run the distribution
```$xslt
java -jar target/integration-service-0.0.1-SNAPSHOT.jar
```## APIs
#### GET /accesstoken
Create access token by login using basic authentication
- Request
```
curl -u user:password http://localhost:8080/accesstoken
```
The bootstrapped account name is 'user' with password is 'password'.- Response:
```
{"accessToken":"vmghl0cd17dpdliknujks3s8al","userName":"user"}
```
Access tokens will expire after 10 minutes.#### POST /submit?access_token=$token
Submit a binary file for processing- Request
```
curl --form file=@./my-cv.doc http://localhost:8080/submit?access_token=vmghl0cd17dpdliknujks3s8al
```- Response
```
{"processId":"b7f2bb75-e8ac-4fec-831b-0d092f9b2b16"}
```#### GET /retrieve/$processId?access_token=$token
Query a processing task
- Request
```
curl localhost:8080/retrieve/b7f2bb75-e8ac-4fec-831b-0d092f9b2b16?access_token=vmghl0cd17dpdliknujks3s8al
```- Response
```
{"id":"b7f2bb75-e8ac-4fec-831b-0d092f9b2b16","state":"COMPLETED","fileName":"my-cv.doc","result":"dummy result"}
```