Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Support for facilitating creating a read-side Cassandra table [don't merge] #130

Closed
wants to merge 1 commit into from

Conversation

dotta
Copy link
Contributor

@dotta dotta commented Jun 30, 2016

I've opened this PR to collect feedback on the functionality and its current implementation

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.

@patriknw what do you think?

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.
@dotta
Copy link
Contributor Author

dotta commented Jun 30, 2016

}.map(_ => Done)

createTable.onFailure {
case err: Throwable => log.error(s"Failed to execute create table statement:\n$createTableStatement. Reason: ${err.getMessage}", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newlines should be avoided in log messages, in my opinion

@patriknw
Copy link
Contributor

patriknw commented Jul 1, 2016

looks like a good utility

@jroper
Copy link
Member

jroper commented Jul 20, 2016

I don't think table creator is a good name - there are more things than creating tables that you might want to do on startup, you might want to update tables for example.

I also think it would be better to provide a utility that would be able to ensure that the table creation is successful before other events are processed. While waiting for the table creation statement to be successful, other events submitted might go into a bounded queue, and would time out if they sat in the queue for too long.

@dotta
Copy link
Contributor Author

dotta commented Jul 21, 2016

Agreed. Then this utility need to be reworked into something more general. Closing for the moment.

@dotta dotta closed this Jul 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants