No description or website provided.
Clone or download
Permalink
Failed to load latest commit information.
bidding-api/src/main/java/com/example/auction/bidding/api Update Lagom to 1.3.6 (#133) Jul 19, 2017
bidding-impl/src Replace deprecated JavaTestKit with current equivalent (#179) Mar 23, 2018
docs build using sbt 1.x + kubernetes deployment (#182) Apr 10, 2018
item-api/src/main/java/com/example/auction/item/api As a buyer, I want to submit payment details of the item (#138) Aug 14, 2017
item-impl/src Replace deprecated JavaTestKit with current equivalent (#179) Mar 23, 2018
project Bump Lagom to 1.4.8 (#191) Aug 31, 2018
search-api/src/main/java/com/example/auction/search/api Add instructions for running in ConductR (#81) Apr 28, 2017
search-impl/src Upgraded to Lagom 1.3.3 (#82) Apr 28, 2017
security/src/main/java/com/example/auction/security Added security and stuff Sep 21, 2016
testkit/src/main/java/com/example/testkit Bumps to Lagom 1.4.1. Fixes some ExCtx issues (#167) Mar 7, 2018
tools/src/main/java/com/example Fix some compiler warnings (#130) Jul 19, 2017
transaction-api/src/main/java/com/example/auction/transaction/api Add feature on Transaction Service: Submit payment status (approved/r… Aug 29, 2017
transaction-impl/src Replace deprecated JavaTestKit with current equivalent (#179) Mar 23, 2018
user-api/src/main/java/com/example/auction/user/api Add login form in User (#152) Aug 30, 2017
user-impl/src Replace deprecated JavaTestKit with current equivalent (#179) Mar 23, 2018
web-gateway/src/main Adds missing execution context to search erro page (#177) Mar 26, 2018
.editorconfig adds .editorconfig file (#147) Aug 16, 2017
.gitignore Add .idea to .gitignore Oct 25, 2016
.sbtopts Basic architecture Sep 4, 2016
.sbtopts.debug search service (#16) Dec 16, 2016
.travis.yml Opt in to the Trusty build environment (#128) Jul 13, 2017
KUBERNETES.md build using sbt 1.x + kubernetes deployment (#182) Apr 10, 2018
LICENSE Basic architecture Sep 4, 2016
README.md Update link to Lightbend Orchestration (#183) Apr 27, 2018
build.sbt build using sbt 1.x + kubernetes deployment (#182) Apr 10, 2018

README.md

Lagom

Gitter

Introduction

Lagom is a Swedish word meaning just right, sufficient. Microservices are about creating services that are just the right size, that is, they have just the right level of functionality and isolation to be able to adequately implement a scalable and resilient system.

Lagom focuses on ensuring that your application realises the full potential of the Reactive Manifesto, while delivering a high productivity development environment, and seamless production deployment experience.

This is a sample Java auction system using the Lagom Framework. A Scala version of the auction system is also available.

When you run the online auction, you access the interface with a browser. You can create user accounts and items for auction. Once the items are available, you can bid.

Prerequisites

To download and run the online auction example you will need:

  • An active internet connection
  • sbt
  • Git

To use the online auction's search facility, you will also need Elasticsearch, which acts as the search database. You can run the example without Elasticsearch, but the search will not work.

  1. To install sbt, refer to the content for your operating system (OS):

  2. Download Elasticsearch server. For example, use a console that supports the curl and tar commands and enter the following commands one at a time:

    1. curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.2.tar.gz
    2. tar -xvf elasticsearch-5.0.2.tar.gz

Running in development mode

To run the online auction example on your local machine:

  1. Clone the online auction github repository to your local machine.

  2. Open a terminal, change into the Elasticsearch bin directory and start Elastic search. For example: 1. cd elasticsearch-5.0.2/bin 1. elasticsearch

  3. Open another terminal and change to the top-level directory of the cloned online auction repository. For example: cd online-auction-java

  4. Run the sample app using the command sbt runAll.

  5. Open a browser and enter: localhost:9000

Exercising the example

To simulate an auction, you'll need to create at least two users and one item. Once created, you can bid on the item. By using different browsers, you can log in as different users and bid on the same item.

Running: Kubernetes

This project uses Lightbend Orchestration for Kubernetes to simplify deployment to Kubernetes.

Refer to KUBERNETES.md for more information on this process.

Importing into IDEs (optional)

Displaying inline instructions (optional)

To get a better understanding of what can be done at each step of the application, inline instructions are displayed on the web UI. To disable these instructions, go to application.conf in the web-gateway micro-service and set online-auction.instruction.show to false.

Online auction system architecture

The auction system is the sum of 5 micro-services and a web gateway:

  • Item Service: Manages the description and auction status (created, auction, completed, cancelled) of an item.
  • Bidding service: Manages bids on items.
  • Search service: Handles all item searching.
  • Transaction service: Handles the transaction of negotiating delivery info and making payment of an item that has completed an auction.
  • user-service: a convenience service to stub user management. Don't use any code in user-service as reference on how to create a secure user management micro-service.
  • web-gateway: a Play application providing web UI and acting as gateway to all previously described services.

Check the docs for each service for details on the commands and queries it serves as well as events the service emits and events it consumes from the Message Broker.

Good to know

  • Hello World seed: For a simple, gentler, introduction to Lagom with Java, have a look at the Hello World Lagom archetype using Maven or Giter8 lagom template with sbt.

  • Getting help: If you have any troubles and need help, feel free to ask in the Gitter channel