https://github.com/making/demo-foundationdb
Demo application using FoundationDB + Spring WebFlux.fn
https://github.com/making/demo-foundationdb
Last synced: 2 days ago
JSON representation
Demo application using FoundationDB + Spring WebFlux.fn
- Host: GitHub
- URL: https://github.com/making/demo-foundationdb
- Owner: making
- Created: 2018-04-22T06:14:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-23T01:48:26.000Z (about 8 years ago)
- Last Synced: 2026-01-21T16:03:11.615Z (5 months ago)
- Language: Java
- Size: 203 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo using FoundationDB + Spring WebFlux.fn
Install fdb-client locally until [it's published to Maven Central](https://github.com/apple/foundationdb/issues/219)
```
mvn validate -P install-fdb
```
[Install](https://apple.github.io/foundationdb/downloads.html) and [start](https://apple.github.io/foundationdb/administration.html#starting-and-stopping) FoundationDB
```
$ curl -v localhost:8080
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< content-length: 0
<
```
```
$ curl localhost:8080 -v -H "Content-Type: text/plain" -d World
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: text/plain
> Content-Length: 5
>
< HTTP/1.1 200 OK
< transfer-encoding: chunked
< Content-Type: text/plain;charset=UTF-8
<
```
```
$ curl -v localhost:8080
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< transfer-encoding: chunked
< Content-Type: text/plain;charset=UTF-8
<
Hello World
```
```
$ curl -v -XDELETE localhost:8080
> DELETE / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 204 No Content
<
```
## Class Scheduling in Spring WebFlux
https://apple.github.io/foundationdb/class-scheduling-java.html
```
$ curl -v localhost:8080/availableClasses
> GET /availableClasses HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< transfer-encoding: chunked
< Content-Type: text/event-stream
<
data:10:00 alg 101
data:10:00 alg 201
data:10:00 alg 301
data:10:00 alg for dummies
...
```
```
$ curl -v -XPOST localhost:8080/signup/foo/2:00%20bio%20for%20dummies
> POST /signup/foo/2:00%20bio%20for%20dummies HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< transfer-encoding: chunked
< Content-Type: text/plain;charset=UTF-8
<
99 seats left
$ curl -v -XPOST localhost:8080/signup/foo/2:00%20bio%20for%20dummies
> POST /signup/foo/2:00%20bio%20for%20dummies HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< transfer-encoding: chunked
< Content-Type: text/plain;charset=UTF-8
<
already signed up
```
```
$ curl -v -XPOST localhost:8080/drop/foo/2:00%20bio%20for%20dummies
> POST /drop/foo/2:00%20bio%20for%20dummies HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< transfer-encoding: chunked
< Content-Type: text/plain;charset=UTF-8
<
100 seats left
$ curl -v -XPOST localhost:8080/drop/foo/2:00%20bio%20for%20dummies
> POST /drop/foo/2:00%20bio%20for%20dummies HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< transfer-encoding: chunked
< Content-Type: text/plain;charset=UTF-8
<
not taking this class
```