Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Chirp tables may fail to be created if cassandra is not up #24

Closed
dotta opened this issue Jun 28, 2016 · 1 comment · Fixed by #39
Closed

Chirp tables may fail to be created if cassandra is not up #24

dotta opened this issue Jun 28, 2016 · 1 comment · Fixed by #39
Labels

Comments

@dotta
Copy link
Contributor

dotta commented Jun 28, 2016

The chirp table are created as part of the chirp service initialization https://github.com/lagom/activator-lagom-java-chirper/blob/master/chirp-impl/src/main/java/sample/chirper/chirp/impl/ChirpServiceImpl.java#L52-L64. If Cassandra is not up (e.g., it's in the process of being started), then the chirp tables won't be created. To avoid the issue, the table should be created only when a connection with the Cassandra server can be established.

@dotta dotta added the bug label Jun 28, 2016
dotta added a commit to dotta/lagom that referenced this issue Jun 30, 2016
As highlighted in lagom/lagom-java-chirper-example#24, making sure that a
read-side table is (eventually) created can be challenging. In particular, users
need to ensure that the create table statement is retried if Cassandra isn't
available.

This commit addresses the problem by encapsulating the retry logic in a new API
class: `CassandraReadSideTableCreator`. Both the number of attempts and the
interval between each attempt is configurable.
@huntc
Copy link
Contributor

huntc commented Nov 22, 2016

Nice work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

2 participants