K
- Message Idpublic class CassandraIdempotentRepository<K>
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.spi.IdempotentRepository<K>
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-datasetsConstructor and Description |
---|
CassandraIdempotentRepository() |
CassandraIdempotentRepository(com.datastax.driver.core.Cluster cluster,
String keyspace) |
CassandraIdempotentRepository(com.datastax.driver.core.Session session) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(K key) |
void |
clear() |
boolean |
confirm(K key) |
boolean |
contains(K key) |
protected void |
doStart() |
protected void |
doStop() |
String[] |
getPKColumns() |
protected Object[] |
getPKValues(K key) |
Object[] |
getPrefixPKValues() |
com.datastax.driver.core.ConsistencyLevel |
getReadConsistencyLevel() |
com.datastax.driver.core.Session |
getSession() |
String |
getTable() |
Integer |
getTtl() |
com.datastax.driver.core.ConsistencyLevel |
getWriteConsistencyLevel() |
protected void |
initClearStatement() |
protected void |
initDeleteStatement() |
protected void |
initInsertStatement() |
protected void |
initSelectStatement() |
protected boolean |
isApplied(com.datastax.driver.core.ResultSet resultSet) |
boolean |
remove(K key) |
void |
setPKColumns(String... pkColumns) |
void |
setPrefixPKValues(Object[] prefixPKValues) |
void |
setReadConsistencyLevel(com.datastax.driver.core.ConsistencyLevel readConsistencyLevel) |
void |
setSession(com.datastax.driver.core.Session session) |
void |
setTable(String table) |
void |
setTtl(Integer ttl) |
void |
setWriteConsistencyLevel(com.datastax.driver.core.ConsistencyLevel writeConsistencyLevel) |
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public CassandraIdempotentRepository()
public CassandraIdempotentRepository(com.datastax.driver.core.Session session)
public CassandraIdempotentRepository(com.datastax.driver.core.Cluster cluster, String keyspace)
protected final boolean isApplied(com.datastax.driver.core.ResultSet resultSet)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.ServiceSupport
Exception
protected void initInsertStatement()
public boolean add(K key)
add
in interface org.apache.camel.spi.IdempotentRepository<K>
protected void initSelectStatement()
public boolean contains(K key)
contains
in interface org.apache.camel.spi.IdempotentRepository<K>
public boolean confirm(K key)
confirm
in interface org.apache.camel.spi.IdempotentRepository<K>
protected void initDeleteStatement()
public boolean remove(K key)
remove
in interface org.apache.camel.spi.IdempotentRepository<K>
protected void initClearStatement()
public void clear()
clear
in interface org.apache.camel.spi.IdempotentRepository<K>
public com.datastax.driver.core.Session getSession()
public void setSession(com.datastax.driver.core.Session 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.driver.core.ConsistencyLevel getWriteConsistencyLevel()
public void setWriteConsistencyLevel(com.datastax.driver.core.ConsistencyLevel writeConsistencyLevel)
public com.datastax.driver.core.ConsistencyLevel getReadConsistencyLevel()
public void setReadConsistencyLevel(com.datastax.driver.core.ConsistencyLevel readConsistencyLevel)
public Object[] getPrefixPKValues()
public void setPrefixPKValues(Object[] prefixPKValues)
Apache Camel