Microservice generating sequence numbers for resources.
Add the following snippet to your docker-compose.yml
:
sequence-numbers:
image: rollvolet/sequence-numbers-service
Add the following rule to the dispatcher config in ./config/dispatcher/dispatcher.ex
post "/sequence-numbers/*path", @json do
Proxy.forward conn, path, "http://sequence-numbers/sequence-numbers/"
end
Get the next sequence number for a product
- 200 OK on successfull generation of a next sequence number.
Example response body
{
"data": {
"type": "sequence-number",
"id": "712a8670-2c45-11eb-865b-d941594a75d9",
"attributes": {
"value": 6344
}
}
}
Reset the in-memory cache of sequence numbers
- 204 No Content on successfull reset of the in-memory cache
Get the current state of the in-memory sequence numbers cache
- 200 OK containing the current state of the cache in the response body
Example response body
{
"data": {
"type": "sequence-number",
"id": "712a8670-2c45-11eb-865b-d941594a75d9",
"attributes": {
"value": 6344
}
}
}