项目作者: murphye
项目描述 :
Sample Lagom/Java application using Cassandra
高级语言: Java
项目地址: git://github.com/murphye/lagom-customer.git
Introduction
This is a sample Lagom/Java application that has a Customer service that allows you, via REST, to:
- Add a customer
- Get a customer
- List customers (via read-side view)
- 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
- curl -H “Content-Type: application/json” -X POST -d ‘{“name”: “Eric Murphy”, “city”: “San Francisco”, “state”: “CA”, “zipCode”: “94105”}’ http://localhost:9000/customer
- curl http://localhost:9000/customer/51c25a39-39b8-4937-b56b-5cca7f79acc1
- curl http://localhost:9000/customer
- curl -X PUT http://localhost:9000/customer/disable/51c25a39-39b8-4937-b56b-5cca7f79acc1
- curl http://localhost:9000/customer/51c25a39-39b8-4937-b56b-5cca7f79acc1 (run again to check disabled)
Relevant Lagom Issues
- Remove @Immutable in favor of Lombok
https://github.com/lagom/lagom/issues/592 - Set cassandra-query-journal.eventual-consistency-delay to 0s
https://github.com/lagom/lagom/issues/497 - Delay as related to integration tests
https://github.com/lagom/lagom/issues/634
Relevant Lombok Links
- https://projectlombok.org/features/Value
- https://projectlombok.org/features/NonNull
- https://projectlombok.org/features/constructor
- https://projectlombok.org/features/Builder
- http://awhitford.github.io/lombok.maven/lombok-maven-plugin/faq.html#needed