lagom / lagom-samples

https://developer.lightbend.com/start/?group=lagom
Creative Commons Zero v1.0 Universal
86 stars 82 forks source link

Undocumented behavior of Topic Subscription with ShoppingCart-Java #205

Closed gabizou closed 3 years ago

gabizou commented 3 years ago

The Problem

I've posted on the forums about my issue, but I have since replicated the same problem in development with the shopping-cart-java sample with a breakpoint in debugging mode, and effectively I can summarize my problem is that Topics are not producing messages in any expected and seemingly not-configurable fashion after startup. For about the first 10 minutes of the application running, messages just simply don't get published and consumed, but the aggregate states are still being updated, and events are being serialized to the Cassandra-backed event journal.

Some Backstory

Being a reactive nature, I'd personally love to be able to use Topics to be able to have reactive services with a lose coupling between services (such as the shopping cart and inventory), but I've not gotten to a point where I can verify that these behaviors of an extreme undocumented lag incurred during the first several minutes are just a byproduct of running in a development environment (using mvn lagom:runAll), or whether there are some configuration options that need to be documented in other ways?

ignasi35 commented 3 years ago

Hi @gabizou, this is the first time we hear of such an issue. Would you be able to provide a reproducer?

gabizou commented 3 years ago

Would you be able to provide a reproducer?

I simply cloned the lagom/shopping-cart-java sample:

ignasi35 commented 3 years ago

I don't remember the details, but I think you need to checkout the shopping cart before the inventory is updated.

curl -X POST http://localhost:9000/shoppingcart/123/checkout
gabizou commented 3 years ago

So I did a re-test with the curl to checkout, turns out it works. My underlying problem turns out to be that https://github.com/akka/akka-persistence-cassandra/issues/867 is giving my development environment the slow-start up that I'm observing.