HUB
Sign inSign up

solsson/gradle-jib-docker

By solsson

•Updated almost 8 years ago

Used to build https://github.com/Yolean/kafka-keyvalue/

Image
0

1.3K

solsson/gradle-jib-docker repository overview

⁠Kafka key-value cache

⁠Example usage

See the Node.js example⁠.

⁠Design choices

  • OnUpdate does not include message value because it could mean that consumers get old values, for example at retries or restarts.
  • Restricted to a single replica per application ID at the moment. Based on bakdata/kafka-key-value-store⁠ we can add support for patitioned stores later.

⁠Constraints

  • Topic keys must be deserializable as String⁠ because these strings are used in REST URIs.

⁠Development

The build-contract⁠ can be used as dev stack.

alias compose='docker-compose -f build-contracts/docker-compose.yml'
gradle jibDockerBuild --image=yolean/kafka-keyvalue:dev
compose up -d cache1
compose up --build example-nodejs-client
compose down

Note: Running build-contract without warmup doesn't work ATM, due to timing issues at start.

During development of the cache itself or the example nodejs client it's more convenient to start only kafka and pixy through docker.

The main class is se.yolean.kafka.keyvalue.cli.Main.

Run the cache service from your IDE with args like: --port 18081 --streams-props bootstrap.servers=localhost:19092 num.standby.replicas=0 --hostname localhost --topic topic1 --application-id kv-test1-local-001 --onupdate http://127.0.0.1:8081/updated

Test manually using for example echo 'mytest={"t":1}' | kafkacat -b localhost:19092 -P -t topic1 -K '='; curl http://localhost:19081/cache/v1/raw/mytest.

Run the nodejs locally using: cd example-nodejs-client; npm ci; ./node_modules/.bin/jest --watch (Note that the mock server for unupdate calls only exists during Jest runs)

Tag summary

Content type

Image

Digest

Size

399.8 MB

Last updated

almost 8 years ago

docker pull solsson/gradle-jib-docker