Closed gabizou closed 3 years ago
Hi @gabizou, this is the first time we hear of such an issue. Would you be able to provide a reproducer?
Would you be able to provide a reproducer?
I simply cloned the lagom/shopping-cart-java sample:
pom.xml
to IntelliJdocker-compose
file for the services (Kafka, zookeeper, Postgres)mvn lagom:runAll
with the debugger and a breakpoint at the flow subscription as line linkedcurl http://localhost:9000/inventory/456
and notice the result is still 0
curl -H "Content-Type: application/json" -d 4 -X POST http://localhost:9000/inventory/456
to add 4 inventorycurl -H "Content-Type: application/json" -d '{"itemId": "456", "quantity": 2}' -X POST http://localhost:9000/shoppingcart/123
to add 2 of 456
to cartcurl http://localhost:9000/inventory/456
and the inventory is still 4.......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
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.
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?