Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.
/ lagom-customer Public archive

Sample Lagom/Java application using Cassandra

Notifications You must be signed in to change notification settings

murphye/lagom-customer

Repository files navigation

Introduction

This is a sample Lagom/Java application that has a Customer service that allows you, via REST, to:

  1. Add a customer
  2. Get a customer
  3. List customers (via read-side view)
  4. Disable a customer (acting as a soft delete)

This implementation uses Cassandra for both the write-side and read-side.

Useful Maven Commands

  • mvn lagom:runAll
  • mvn clean package docker:build

Example curl commands

  1. curl -H "Content-Type: application/json" -X POST -d '{"name": "Eric Murphy", "city": "San Francisco", "state": "CA", "zipCode": "94105"}' http://localhost:9000/customer
  2. curl http://localhost:9000/customer/51c25a39-39b8-4937-b56b-5cca7f79acc1
  3. curl http://localhost:9000/customer
  4. curl -X PUT http://localhost:9000/customer/disable/51c25a39-39b8-4937-b56b-5cca7f79acc1
  5. curl http://localhost:9000/customer/51c25a39-39b8-4937-b56b-5cca7f79acc1 (run again to check disabled)

Relevant Lagom Issues

  1. Remove @Immutable in favor of Lombok lagom/lagom#592
  2. Set cassandra-query-journal.eventual-consistency-delay to 0s lagom/lagom#497
  3. Delay as related to integration tests lagom/lagom#634

Relevant Lombok Links

  1. https://projectlombok.org/features/Value
  2. https://projectlombok.org/features/NonNull
  3. https://projectlombok.org/features/constructor
  4. https://projectlombok.org/features/Builder
  5. http://awhitford.github.io/lombok.maven/lombok-maven-plugin/faq.html#needed