public class CassandraIdempotentRepository
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.IdempotentRepository
IdempotentRepository using Cassandra table to store message ids. Advice: use
LeveledCompaction for this table and tune read/write consistency levels. Warning: Cassandra is not the best tool for
queuing use cases See http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets| Constructor and Description |
|---|
CassandraIdempotentRepository() |
CassandraIdempotentRepository(com.datastax.oss.driver.api.core.CqlSession session) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String key) |
void |
clear() |
boolean |
confirm(String key) |
boolean |
contains(String key) |
protected void |
doStart() |
protected void |
doStop() |
String[] |
getPKColumns() |
protected Object[] |
getPKValues(String key) |
String[] |
getPrefixPKValues() |
com.datastax.oss.driver.api.core.ConsistencyLevel |
getReadConsistencyLevel() |
com.datastax.oss.driver.api.core.CqlSession |
getSession() |
String |
getTable() |
Integer |
getTtl() |
com.datastax.oss.driver.api.core.ConsistencyLevel |
getWriteConsistencyLevel() |
protected void |
initClearStatement() |
protected void |
initDeleteStatement() |
protected void |
initInsertStatement() |
protected void |
initSelectStatement() |
protected boolean |
isApplied(com.datastax.oss.driver.api.core.cql.ResultSet resultSet) |
boolean |
remove(String key) |
void |
setPKColumns(String... pkColumns) |
void |
setPrefixPKValues(String[] prefixPKValues) |
void |
setReadConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel readConsistencyLevel) |
void |
setSession(com.datastax.oss.driver.api.core.CqlSession session) |
void |
setTable(String table) |
void |
setTtl(Integer ttl) |
void |
setWriteConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel writeConsistencyLevel) |
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, confirm, contains, removepublic CassandraIdempotentRepository()
public CassandraIdempotentRepository(com.datastax.oss.driver.api.core.CqlSession session)
protected final boolean isApplied(com.datastax.oss.driver.api.core.cql.ResultSet resultSet)
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.BaseServiceExceptionprotected void initInsertStatement()
public boolean add(String key)
add in interface org.apache.camel.spi.IdempotentRepositoryprotected void initSelectStatement()
public boolean contains(String key)
contains in interface org.apache.camel.spi.IdempotentRepositorypublic boolean confirm(String key)
confirm in interface org.apache.camel.spi.IdempotentRepositoryprotected void initDeleteStatement()
public boolean remove(String key)
remove in interface org.apache.camel.spi.IdempotentRepositoryprotected void initClearStatement()
public void clear()
clear in interface org.apache.camel.spi.IdempotentRepositorypublic com.datastax.oss.driver.api.core.CqlSession getSession()
public void setSession(com.datastax.oss.driver.api.core.CqlSession session)
public String getTable()
public void setTable(String table)
public String[] getPKColumns()
public void setPKColumns(String... pkColumns)
public Integer getTtl()
public void setTtl(Integer ttl)
public com.datastax.oss.driver.api.core.ConsistencyLevel getWriteConsistencyLevel()
public void setWriteConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel writeConsistencyLevel)
public com.datastax.oss.driver.api.core.ConsistencyLevel getReadConsistencyLevel()
public void setReadConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel readConsistencyLevel)
public String[] getPrefixPKValues()
public void setPrefixPKValues(String[] prefixPKValues)
Apache Camel