- Java8
- Spring webflux
- Spring data
- Dynamodb
- Junit
- sl4j
- Reactor
https://app.swaggerhub.com/apis-docs/edabruzzo/default-title/0.1
http://localhost:8080/webjars/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config
curl --location --request GET 'localhost:8080/heroes/4'
curl --location --request POST 'localhost:8080/heroes/' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":"2",
"name":"Genoveva",
"universe":"Encantado",
"countFilmes":10
}'
curl --location --request GET 'localhost:8080/heroes'
curl --location --request DELETE 'localhost:8080/heroes/2'
curl --location --request PUT 'localhost:8080/heroes/4' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "4",
"name":"Amélia",
"universe":"All",
"countFilms":4
}'
docker pull amazon/dynamodb-local
docker run -p 8000:8000 amazon/dynamodb-local
On project root dir run:
emmanuel@computer:~/NetBeansProjects/DigitalOne_2/SPRING_WEBFLUX_API_HEROES_EMM/WebFluxReactiveAPI$ sudo docker-compose up -d dynamodb-local
[sudo] password for emmanuel:
WARNING: The Docker Engine you're using is running in swarm mode.
Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.
To deploy your application across the swarm, use `docker stack deploy`.
Creating network "webfluxreactiveapi_default" with the default driver
Creating dynamodb-local ... done
After getting your local DyanamoDB instance successfully set up, now you should be able to see it running on http://localhost:8000 . We can pass this address to AWS-CLI or AWS-SDK as our preferred DynamoDB endpoint URL and start accessing it.
$ aws dynamodb <command> --endpoint-url http://localhost:8000
DynamoDbClient client = DynamoDbClient.builder()
.region(Region.US_WEST_2)
.endpointOverride(
URI.create("http://localhost:8000"))
.build();
Python (Boto3)
import boto3# Get the service client
db = boto3.client('dynamodb',endpoint_url='http://localhost:8000')# Get the service resource
db = boto3.resource('dynamodb',endpoint_url='http://localhost:8000')
$ npm install -g dynamodb-admin
// For Windows
set DYNAMO_ENDPOINT=http://localhost:8000
dynamodb-admin// For Mac/Linux
export DYNAMO_ENDPOINT=http://localhost:8000
$ dynamodb-admin
Now visit http://localhost:8001 on your web browser to access the dynamodb-admin GUI.
-
https://speakerdeck.com/kamilahsantos/live-coding-dio-api-de-herois-com-spring-webflux
-
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
-
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
Documentacao gerada pela aplicação: swagger:
-
https://medium.com/platform-engineer/running-aws-dynamodb-local-with-docker-compose-6f75850aba1e
-
https://medium.com/@nithinmallya4/processing-streaming-data-with-spring-webflux-ed0fc68a14de
-
https://stackoverflow.com/questions/60611730/properly-ways-to-testing-webflux-rest-api
-
https://howtodoinjava.com/spring-webflux/webfluxtest-with-webtestclient/