Skip to content

Example project for Spring Boot RSocket with Protocol Buffer

Notifications You must be signed in to change notification settings

kprasad99/spring-rsocket-protobuf

Repository files navigation

Spring RSocket Protobuf

Example project for Spring Boot RSocket with Protocol Buffer

Example Feature.

  • RSocket client-server.

  • Endpoint /api/person → json endpoint with simple pojo.

  • Endpoint /api/proto-json/person → protobuf object as a json endpoint(Not working).

  • Endpoint /api/proto/person → protobuf object endpoint.

  • Endpoint /api/rsoc/person → rsocket client-server endpoint with protobuf mime type.

  • Ports

    • person service → 8080

    • person service rsocket → 9080

    • person client service → 8081

    • person client service rsocket → 9081

  • Performance of the varies endpoint/communication modes can be compared using actuator endpoint /actuator/prometheus of person-client-service

How to test rsocket directly.

  • Download rsc.jar, a rsocket cli client.

  • Now execute below command to retrieve json data.

    java -jar rsc-0.4.2.jar tcp://localhost:9080 \
        -r io.github.kprasad99.json.person \
        --stream

Compare the performance of endpoints.

Though the data is too less you can add the data to database before running the applicaiton.

  • Start the applications, prometheus and grafana.

    $ docker-compose -f docker-compose-dev.yml up -d
    Note
    openjdk docker image is a custom image, you might need to change to any available jdk-11 one.
  • Once the application is started open Grafana UI at http://localhost:30072

    Note
    Default username/password is admin/admin
  • Open postman and import collection postman/spring-rsocket-protobuf.postman_collection.json.

  • Now use the runner tool to run the collection with N-number of requests.

About

Example project for Spring Boot RSocket with Protocol Buffer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published