Giter Site home page Giter Site logo

online-auction-java's Introduction

Gitter Join the contributors chat at https://gitter.im/lagom/contributors CI / Build and tests Open Source Helpers

Deprecated - Lagom - July 1 2023

This project will only recieve security patches until July 1, 2024, at that point the project will no longer receive any additional patches.

If you are an existing customer of Lightbend and we have not yet contacted you, please reach out to Support.

We recommend migrating any existing work to:

  • Akka for deeply customized projects with complex infrastructure needs. Akka now contains the vast majority of Lagom features.
  • Kalix for a managed scalable environment with an abstraction above the Akka framework layer to allow you to focus only on business logic.

Lagom - The Reactive Microservices Framework

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 realizes the full potential of the Reactive Manifesto while delivering a high productivity development environment, and seamless production deployment experience.

Learn More

License

Copyright (C) Lightbend Inc. (https://www.lightbend.com).

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

online-auction-java's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

online-auction-java's Issues

INSTRUCTIONS: Edit items

Add inline instructions on how/when a user can edit an item.

An eager user should have some brief info on how/when an item can be edited (item ownership, item status, etc...)

transaction service impl fails when auction has no winner.

Current master, transaction service is subscribed to items topic.
Through that topic, an AuctionFinished event may be received. That event contains an Optional<UUID> winner but there may be auctions without winner.
Current code assumes the Optional<UUID> winner will always exist:

When there's no winner that code crashes and subscription becomes useless.

Scala code not picked up

Using scala code (case classes) to create value objects and then use them from java is no possible.
sbt compilation will fail with a symbol not found message.

When a user increases their bid from one that's below the reserve, the current price is not updated

Steps to reproduce:

  1. Create and start an auction with a reserve price of $10 (make sure the duration of the auction is greater than 10 seconds).
  2. As another user, place a bid of $5. The big should be accepted, and the returned message should be that it's below the reserve.
  3. As that same user, place a bid of $12.

Expected outcome

The bid is accepted, and the current price is updated to $10, to match the reserve.

Actual outcome

The bid is accepted, but the current price stays at $5, below the reserve.

This also happens if you were to bid, for example, $7.

There is already a comprehensive suite of tests in AuctionEntityTest.java, tests for these scenarios should be added first, to reproduce the problem, then the bug in AuctionEntity can be fixed.

Replace ItemService.getUsers

Right now, the getUsers service implementation is not ideal:

        // Note this should never make production....
        return req -> currentIdsQuery.currentPersistenceIds()
                .filter(id -> id.startsWith("PUserEntity"))
                .mapAsync(4, id -> entityRef(id.substring(11)).ask(PUserCommand.GetPUser.INSTANCE))
                .filter(Optional::isPresent)
                .map(user -> Mappers.toApi(user.get()))
                .runWith(Sink.seq(), mat)
                .thenApply(TreePVector::from);

As you can tell from the comment, this code is a quick hack... not something that should be considered a good example of writing a Lagom service.

It has a few problems:

  • It is slow. This requires loading each user entity into memory to query it for its details. In a multi-node cluster, this will require multiple calls across the network.
  • It is fragile. It assumes too much about the format of the persistence ID string. See #115 for an example of the problems this causes
  • It does not scale well. In a realistic system with a large number of users, this will return a very long list with no pagination.
  • It is written in a very functional style that may be unfamiliar to many Java developers.

This service call is used by the web-gateway application to load a list of all users in the Nav. This is then used in turn for different purposes:

  1. To create a list of users in the navigation bar, which allows you to log in as different users
  2. To look up user details given a user ID, as an optimization of calling userService.getUser for each ID, since all of the user information was already loaded and cached locally for the navigation bar

These can be replaced by different means.

Navigation bar

In the navigation bar, it might be better to show a bounded list of recently-created users. For example, we could put the ten most recently-created users in the list, rather than all of the users in the system. For most demo purposes, it will be exactly the same, since most people won't create that many users. However, if we decide to extend the demo to create users automatically (see #110 for example) then we might want to include a script that creates many more than ten users.

This is a perfect case for a read-side table in Lagom. This would look similar to the existing read-side processor in the item service and the one currently under review in the transaction service (#106). It would maintain a table of users and their creation date that could be queried by the service implementation in a new getRecentUsers service call. We would need to extend the PUserCreated event to carry a createdAt timestamp.

User lookups

I think that using the navigation to look up user details, rather than making calls to userService.getUser(id), could be considered a premature optimization. I suggest we undo that and stick with making the calls for now.

If we want to demonstrate optimizations in the future, we have a few options:

  1. We could keep calling getUser(id) but maintain a local cache, so it doesn't have to be called as often
  2. We could replace the getUsers() call that returns all users with a call that takes a list of user IDs to return
  3. We could publish user events to Kafka, and have the web-gateway listen to these events and maintain its own internal copy of user display names

Missing ServiceInfo for webGateway causes startup failure.

When installing the app in ConductR the web-gateway fails to start:


1) Could not find a suitable constructor in com.lightbend.lagom.javadsl.api.ServiceInfo. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at com.lightbend.lagom.javadsl.api.ServiceInfo.class(ServiceInfo.java:13)
  while locating com.lightbend.lagom.javadsl.api.ServiceInfo
    for parameter 2 at com.lightbend.lagom.internal.client.ServiceClientImplementor.<init>(ServiceClientImplementor.scala:44)
  while locating com.lightbend.lagom.internal.client.ServiceClientImplementor
    for parameter 3 at com.lightbend.lagom.internal.client.ServiceClientLoader.<init>(ServiceClientLoader.scala:16)
  while locating com.lightbend.lagom.internal.client.ServiceClientLoader
    for field at com.lightbend.lagom.internal.client.ServiceClientProvider.loader(ServiceClientLoader.scala:37)
  at com.lightbend.lagom.javadsl.client.ServiceClientGuiceSupport.bindClient(ServiceClientGuiceSupport.java:14) (via modules: com.google.inject.util.Modules$OverrideModule -> Module)

2) Could not find a suitable constructor in com.lightbend.lagom.javadsl.api.ServiceInfo. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at com.lightbend.lagom.javadsl.api.ServiceInfo.class(ServiceInfo.java:13)
  while locating com.lightbend.lagom.javadsl.api.ServiceInfo
    for parameter 2 at com.lightbend.lagom.internal.client.ServiceClientImplementor.<init>(ServiceClientImplementor.scala:44)
  while locating com.lightbend.lagom.internal.client.ServiceClientImplementor
    for parameter 3 at com.lightbend.lagom.internal.client.ServiceClientLoader.<init>(ServiceClientLoader.scala:16)
  while locating com.lightbend.lagom.internal.client.ServiceClientLoader
    for field at com.lightbend.lagom.internal.client.ServiceClientProvider.loader(ServiceClientLoader.scala:37)
  at com.lightbend.lagom.javadsl.client.ServiceClientGuiceSupport.bindClient(ServiceClientGuiceSupport.java:14) (via modules: com.google.inject.util.Modules$OverrideModule -> Module)

3) Could not find a suitable constructor in com.lightbend.lagom.javadsl.api.ServiceInfo. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at com.lightbend.lagom.javadsl.api.ServiceInfo.class(ServiceInfo.java:13)
  while locating com.lightbend.lagom.javadsl.api.ServiceInfo
    for parameter 2 at com.lightbend.lagom.internal.client.ServiceClientImplementor.<init>(ServiceClientImplementor.scala:44)
  while locating com.lightbend.lagom.internal.client.ServiceClientImplementor
    for parameter 3 at com.lightbend.lagom.internal.client.ServiceClientLoader.<init>(ServiceClientLoader.scala:16)
  while locating com.lightbend.lagom.internal.client.ServiceClientLoader
    for field at com.lightbend.lagom.internal.client.ServiceClientProvider.loader(ServiceClientLoader.scala:37)
  at com.lightbend.lagom.javadsl.client.ServiceClientGuiceSupport.bindClient(ServiceClientGuiceSupport.java:14) (via modules: com.google.inject.util.Modules$OverrideModule -> Module)

4) Could not find a suitable constructor in com.lightbend.lagom.javadsl.api.ServiceInfo. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at com.lightbend.lagom.javadsl.api.ServiceInfo.class(ServiceInfo.java:13)
  while locating com.lightbend.lagom.javadsl.api.ServiceInfo
    for parameter 2 at com.lightbend.lagom.internal.client.ServiceClientImplementor.<init>(ServiceClientImplementor.scala:44)
  while locating com.lightbend.lagom.internal.client.ServiceClientImplementor
    for parameter 3 at com.lightbend.lagom.internal.client.ServiceClientLoader.<init>(ServiceClientLoader.scala:16)
  while locating com.lightbend.lagom.internal.client.ServiceClientLoader
    for field at com.lightbend.lagom.internal.client.ServiceClientProvider.loader(ServiceClientLoader.scala:37)
  at com.lightbend.lagom.javadsl.client.ServiceClientGuiceSupport.bindClient(ServiceClientGuiceSupport.java:14) (via modules: com.google.inject.util.Modules$OverrideModule -> Module)

4 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at com.typesafe.conductr.bundlelib.play.api.ConductRApplicationLoader.load(ConductRApplicationLoader.scala:21)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:47)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)
17:14:08  accd4f3a7956  Component webgateway exited with 255
Stopping bundle

That's a play App trying to invoke bindClient() but there's no ServiceInfoProvider available causing the Guice creation to fail.

Creating a ServiceInfoProvider in ServiceClientGuiceSupport has some undesired effects on ServiceLocator and ServiceRegistry.

Move CassandraReadSideUtils and CompletionStageUtils to core

./item-impl/src/main/java/com/example/auction/item/impl/CassandraReadSideUtils.java:11:
// TODO: move to core?
./tools/src/main/java/com/example/core/CompletionStageUtils.java:14:
// TODO: move to core?

Move CassandraReadSideUtils (item-impl) and CompetionStageUtils (tools) into the core Lagom framework

Project is not working properly with activator

This project is no longer properly working with $ activator runAll
On gitter I got to know that lagom is gradually moving out of activator. I suggest we should remove activator and activator.bat

Use .deb installers in Travis

After #61 was merged the jobs in Travis are run using sudo: required. This takes the build out of a container into a VM where sudo can be used.

Without that restriction it may be possible to install elasticsearch by other means.

There may still be a restriction wrt installing the exact version we need to run the tests though.

ServiceLocator is not bound

I pulled down the project and tried to runAll but I just get into a loop of not being able to locate Cassandra.

[warn] c.l.l.i.p.c.ServiceLocatorSessionProvider - Could not find Cassandra contact points, due to: ServiceLocator is not bound
[warn] a.p.c.j.CassandraJournal - Failed to connect to Cassandra and initialize. It will be retried on demand. Caused by: ServiceLocator is not bound
[error] a.a.OneForOneStrategy - Ask timed out on [Actor[akka://transactionImpl-application/user/cassandraOffsetStorePrepare-singleton/singleton/cassandraOffsetStorePrepare#-352900502]] after [20000 ms]. Sender[Actor[akka://transactionImpl-application/user/cassandraOffsetStorePrepare-singleton/singleton/cassandraOffsetStorePrepare#-352900502]] sent message of type "com.lightbend.lagom.internal.persistence.cluster.ClusterStartupTaskActor$Execute$".
akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://transactionImpl-application/user/cassandraOffsetStorePrepare-singleton/singleton/cassandraOffsetStorePrepare#-352900502]] after [20000 ms]. Sender[Actor[akka://transactionImpl-application/user/cassandraOffsetStorePrepare-singleton/singleton/cassandraOffsetStorePrepare#-352900502]] sent message of type "com.lightbend.lagom.internal.persistence.cluster.ClusterStartupTaskActor$Execute$".
	at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:604) ~[akka-actor_2.11-2.4.17.jar:na]
	at akka.actor.Scheduler$$anon$4.run(Scheduler.scala:126) ~[akka-actor_2.11-2.4.17.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:601) ~[scala-library-2.11.8.jar:na]
	at scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:109) ~[scala-library-2.11.8.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:599) ~[scala-library-2.11.8.jar:na]
	at akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(LightArrayRevolverScheduler.scala:329) ~[akka-actor_2.11-2.4.17.jar:na]
	at akka.actor.LightArrayRevolverScheduler$$anon$4.executeBucket$1(LightArrayRevolverScheduler.scala:280) ~[akka-actor_2.11-2.4.17.jar:na]
	at akka.actor.LightArrayRevolverScheduler$$anon$4.nextTick(LightArrayRevolverScheduler.scala:284) ~[akka-actor_2.11-2.4.17.jar:na]
	at akka.actor.LightArrayRevolverScheduler$$anon$4.run(LightArrayRevolverScheduler.scala:236) ~[akka-actor_2.11-2.4.17.jar:na]
	at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_121]

localhost:8000/services

[{"name":"cas_native","url":"tcp://127.0.0.1:4000/cas_native"},{"name":"kafka_native","url":"tcp://localhost:9092/kafka_native"},{"name":"elastic-search","url":"http://127.0.0.1:9200"}]

Review ItemServiceImplIntegrationTest to see if kafka-testkit could be of help.

Upgrade to Lagom 1.3.0

Lagom 1.3.0 introduces some features that should be showcased in online-auction-java:

  • ProducerStub for testing Broker consumption
  • replacing service-name and acls configurations with bindServiceInfoprogrammatic approach.

Search Service loses events

When running the application on a clean environment, if elasticsearch is not running and a user creates an item then that item will not be searchable.

Steps to reproduce:

  • run the app (make sure the elasticsearch DB is not running)
  • create a user "bob" and with that create an item "chair" with a time to auction of 1 day and start the auction
  • wait few seconds
  • make sure the elasticsearch data/ folder is empty so that no index with previous data exists and start elasticsearch
  • using "bob" create an item "car" with a time to auction of 1 day and start the auction
  • go to "search" in the top right corner of the screen and search "chair" and then search "car"

Expected:

  • each search returns the item under auction

Actual:

  • only "car" is returned

Comments:

I haven't tracked down all possible scenarios where this issue happens. Here's some suspicions that can help narrow the cases:

  • only happens when the Elasticsearch index doesn't exist.
  • only the item-service or the bid-events messages from kafka are lost (I highly doubt that since search-service reuses a lot of code to consume from both topics)
  • the error is not propagating the storage failure from here to here so events are marked as consumed in kafka

Use Case: As a user, I want to see my transactions

This is based on Item service implementation

  • Add service call getTransactionsForUser and TransactionRepository (#106)
  • Add tests: TransactionRepositoryTest (#106)
  • web-gateway: Show transactions on /my/transactions (#135)

Although it's not related, this task is pending:

  • Ensure that exception.getCause() in this line will always be a TransportException (see this)

Pre-load a few users and items

It is cumbersome to create multiple users and at least one item before you can actually exercise the app and bid on something. It would be nice to add a script that loads a few users and items so that someone who downloads and runs online auction could observe the main functionality right away. They could still add other users and items if they wish.

Update CreateItem command

./item-impl/src/main/java/com/example/auction/item/impl/ItemServiceImpl.java:82:
// TODO: remove this PItem from here and pass the 3 values in the command?
./item-impl/src/main/java/com/example/auction/item/impl/PItemCommand.java:23:
// TODO: change payload of this command.

PItemCommand.CreateItem (item-impl) should take 3 params:

  • itemId: UUID
  • userId: UUID
  • details: PItemData

And remove PItem object in ItemServiceImpl#createItem

Use Case: As a seller, I want to set delivery price for the buyer

  • Add entity tests: shouldEmitEventWhenSettingDeliveryPrice, shouldForbidSettingDeliveryPriceByNonSeller
  • Add service test: shouldSetDeliveryPrice
  • Update TransactionEntity and add service call ServiceCall<Integer, Done> setDeliveryPrice(UUID itemId)
  • UI: transaction.scala.html will show a button "Set delivery price" if the current user is the seller and it will redirect to form for submit the delivery price

Provide a Maven example

We discussed converting this project to Maven as an example for Maven/Java users.

Our current thinking is to have both build.sbt and pom.xml files on the master branch, and then to also have long lived sbt and maven branches that strip the opposite build files out.

Using ctx.commandFailed with a subclass of TransportException breaks test

Current state:

  • AuctionEntity
  • PItemEntity
    • Use ctx.commandFailed with UpdateFailureException which isn't a subclass of TransportException and implements equals and hashCode
      Test is also passing
    • Use ctx.commandFailed with NotFound which is a subclass of TransportException
      Test is ignored
  • TransactionEntity

We need to tidy up this, whether throwing an exception or using ctx.commandFailed in all services

Run tests on multiple scala versions

While working on PR #61 the main comand to run the tests sbt +test changed and the current command is not executing the tests cross-scala version: sbt -DenableElasticsearch=true test .

This is probably what we want but I'd like to double check it was not added on purpose to demo a particular feature.

/cc @jroper

Complete Javadoc comments

./item-impl/src/main/java/com/example/auction/item/impl/ItemServiceImpl.java:53:
// TODO: doc this.

Write doc comments for the Javadoc in item-impl: ItemServiceImpl#handleBidEvent. Also complete the doc comments for this services API (following the example in bidding-api and item-api):

  • search-api: SearchService#search
  • user-api: UserService#createUser, UserService#getUser, UserService#getUsers

Merge PItemState and PItem

PItem and PItemState should be merged. This change will require JSON Evolutions which is why I think it'd better be done as a separate PR.

User with username and password auth

As per email if we should provide username and password based login. We get two options for it.

  • Basic Auth with saving username and password within User itself.
  • OAuth/OAuth2 by using any third party lib.

In basic auth it will need every call to send username and password. That is generally not favourable though.

Enable ElasticSearch tests on Travis

Use Travis CI's support for databases and ScalaTest tagging to run search-impl integration tests with ElasticSearch.

A possible issue will be the version miss-match between Travis options and our code/API client.

See also lagom/lagom#569

Reuse PaginatedSequence and move to a common project

./item-api/src/main/java/com/example/auction/item/api/PaginatedSequence.java:9:
// TODO: move to a common sbt project to reuse from searchApi
./search-api/src/main/java/com/example/auction/search/api/SearchResult.java:7:
// TODO: migrate to PaginatedSequence and reuse code. Needs moving PaginatedSequence to a shared project.
  • Move PaginatedSequence.java (item-api) to com.example.auction.utils in security project (like in online-auction-scala)
  • Migrate SearchResult to use PaginatedSequence

Fresh master clone can't be used

A fresh clone of master is not runnable:

  1. clone
  2. sbt runAll
  3. create a user

Expected

Default user home is displayed

Actual


[warn] o.a.k.c.NetworkClient - Error while fetching metadata with correlation id 1 : {item-ItemEvent=LEADER_NOT_AVAILABLE}
[warn] o.a.k.c.NetworkClient - Error while fetching metadata with correlation id 2 : {item-ItemEvent=LEADER_NOT_AVAILABLE}
[warn] o.a.k.c.NetworkClient - Error while fetching metadata with correlation id 1 : {bidding-BidEvent=LEADER_NOT_AVAILABLE}
[info] o.h.v.i.u.Version - HV000001: Hibernate Validator 5.2.4.Final
[info] Service webGateway listening for HTTP on 0:0:0:0:0:0:0:0:60496
[info] Service searchImpl listening for HTTP on 0:0:0:0:0:0:0:0:55320
[info] Service itemImpl listening for HTTP on 0:0:0:0:0:0:0:0:53203
[info] Service transactionImpl listening for HTTP on 0:0:0:0:0:0:0:0:51742
[info] Service biddingImpl listening for HTTP on 0:0:0:0:0:0:0:0:58427
[info] Service userImpl listening for HTTP on 0:0:0:0:0:0:0:0:56181
[info] (Services started, press enter to stop and go back to the console...)
[error] application - 

! @74f86hh4b - Internal server error, for (GET) [/my/items/created] ->
 
play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[CompletionException: java.util.NoSuchElementException: No value present]]
        at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:293)
        at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:220)
        at play.api.GlobalSettings$class.onError(GlobalSettings.scala:160)
        at play.api.DefaultGlobal$.onError(GlobalSettings.scala:188)
        at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:100)
        at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100)
        at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
        at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
        at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
Caused by: java.util.concurrent.CompletionException: java.util.NoSuchElementException: No value present
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
        at java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1107)
        at java.util.concurrent.CompletableFuture$BiApply.tryFire(CompletableFuture.java:1070)
        ... 5 common frames omitted
Caused by: java.util.NoSuchElementException: No value present
        at java.util.Optional.get(Optional.java:135)
        at views.html.myItems_Scope0$myItems_Scope1$myItems.apply(myItems.template.scala:41)
        at views.html.myItems_Scope0$myItems_Scope1$myItems.render(myItems.template.scala:110)
        at views.html.myItems.render(myItems.template.scala)
        at controllers.ProfileController.lambda$null$0(ProfileController.java:41)
        at java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1105)
        at java.util.concurrent.CompletableFuture$BiApply.tryFire(CompletableFuture.java:1070)
        at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)

Routes collision in ConductR

When deploying the application in ConductR it deems unusable due to a route collision.

The collision is for the route:

POST /user

that should only be resolved by webGateway as described in https://github.com/lagom/online-auction-java/blob/master/web-gateway/conf/routes#L6

but the default bundle.conf for users-impl is configuring the service as:

version              = "1"
name                 = "userimpl"
compatibilityVersion = "1"
system               = "userimpl"
systemVersion        = "1"
nrOfCpus             = 0.1
memory               = 402653184
diskSpace            = 200000000
roles                = ["web"]
components = {
  userimpl = {
    description      = "userImpl"
    file-system-type = "universal"
    start-command    = ["userimpl/bin/userimpl", "-J-Xms134217728", "-J-Xmx134217728", "-Dhttp.address=$USER_BIND_IP", "-Dhttp.port=$USER_BIND_PORT", "-Dplay.crypto.secret=75736572496d706c"]
    endpoints = {
      "user" = {
        bind-protocol = "http"
        bind-port     = 0
        services      = ["http://:9000/user"]  <-- I suspect this is the cause of the collision.
      },
      "akka-remote" = {
        bind-protocol = "tcp"
        bind-port     = 0
        services      = []
      }
    }
  }
}

UPDATE: similar collisions with /item and /search.

Beef up readme

The readme should explain that you open the UI with a browser and how (in general terms) to start an auction.

Update tests to use testkit project

#121 was merged, next steps are related to updating the existing tests to use the new testkit project
Since all source code for testkit project was extracted from Item service, I only updated the dependencies in that service

  • Update tests in Transaction Service (#134)
  • Update tests in User Service (#139)
  • Maybe we should add integration tests on Bidding Service? #173

Inline instructions

Add a feature-flag (enabled by default) to display inline instructions on the user's UI. This means adding text snippets in the rendered HTML so that an eager user gets info in the actual UI when using the app.

Having inline instructions should help a new user get a better understanding of what can be done with the app once started. The feature flag will hide the inline instructions and is meant to remove noise if/when demoing the app.

This feature flag will control the data added in #59 (wip #68 ) , #58(done), #57(done) and #56 (done).

The existence of this inline help should be introduced in the README.md.
The steps to disable the feature should be documented in the repo README.md.

compilation errors

I cloned this (as sbt project) into IntelliJ, Java 8, and got the following:

Information:5/1/2017 8:11 PM - Compilation completed with 12 errors and 0 warnings in 2m 1s 500ms
C:\Users\RLOPACs\online-auction-java\tools\src\main\java\com\example\auction\pagination\PaginatedSequence.java
Error:(3, 14) java: package lombok does not exist
Error:(4, 24) java: package org.pcollections does not exist

Error:(9, 2) java: cannot find symbol
symbol: class Value

Error:(11, 5) java: cannot find symbol
symbol: class PSequence
location: class com.example.auction.pagination.PaginatedSequence

Error:(16, 30) java: cannot find symbol
symbol: class PSequence
location: class com.example.auction.pagination.PaginatedSequence

Error:(3, 12) java: package akka does not exist

Error:(24, 35) java: cannot find symbol
symbol: class Done
location: class com.example.core.CompletionStageUtils

Error:(35, 39) java: cannot find symbol
symbol: class Done
location: class com.example.core.CompletionStageUtils

Error:(36, 74) java: cannot find symbol
symbol: variable Done
location: class com.example.core.CompletionStageUtils

Error:(36, 74) java: cannot find symbol
symbol: variable Done
location: class com.example.core.CompletionStageUtils

INSTRUCTIONS: search items

Add inline instructions on how/when to search an item and how the feature is enabled.
An eager user should be helped/guided into enabling and using the search feature. That means linking to the repo README.md on how to enable a local elasticsearch instance and explaining how search filters work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.