Class CassandraIdempotentRepository
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.processor.idempotent.cassandra.CassandraIdempotentRepository
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.IdempotentRepository
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
NamedCassandraIdempotentRepository
@Metadata(label="bean",
description="Idempotent repository that uses Cassandra table to store message ids. Advice: use LeveledCompaction for this table and tune read/write consistency levels.",
annotations="interfaceName=org.apache.camel.spi.IdempotentRepository")
@Configurer(metadataOnly=true)
public class CassandraIdempotentRepository
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.IdempotentRepository
Implementation of
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-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
ConstructorDescriptionCassandraIdempotentRepository
(com.datastax.oss.driver.api.core.CqlSession session) -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
clear()
boolean
boolean
protected void
doStart()
protected void
doStop()
protected Object[]
getPKValues
(String key) com.datastax.oss.driver.api.core.ConsistencyLevel
com.datastax.oss.driver.api.core.CqlSession
getTable()
getTtl()
com.datastax.oss.driver.api.core.ConsistencyLevel
protected void
protected void
protected void
protected void
protected final boolean
isApplied
(com.datastax.oss.driver.api.core.cql.ResultSet resultSet) boolean
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
void
void
setWriteConsistencyLevel
(com.datastax.oss.driver.api.core.ConsistencyLevel writeConsistencyLevel) Methods inherited from class org.apache.camel.support.service.BaseService
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, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.spi.IdempotentRepository
add, confirm, contains, remove
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
CassandraIdempotentRepository
public CassandraIdempotentRepository() -
CassandraIdempotentRepository
public CassandraIdempotentRepository(com.datastax.oss.driver.api.core.CqlSession session)
-
-
Method Details
-
isApplied
protected final boolean isApplied(com.datastax.oss.driver.api.core.cql.ResultSet resultSet) -
getPKValues
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
initInsertStatement
protected void initInsertStatement() -
add
- Specified by:
add
in interfaceorg.apache.camel.spi.IdempotentRepository
-
initSelectStatement
protected void initSelectStatement() -
contains
- Specified by:
contains
in interfaceorg.apache.camel.spi.IdempotentRepository
-
confirm
- Specified by:
confirm
in interfaceorg.apache.camel.spi.IdempotentRepository
-
initDeleteStatement
protected void initDeleteStatement() -
remove
- Specified by:
remove
in interfaceorg.apache.camel.spi.IdempotentRepository
-
initClearStatement
protected void initClearStatement() -
clear
public void clear()- Specified by:
clear
in interfaceorg.apache.camel.spi.IdempotentRepository
-
getSession
public com.datastax.oss.driver.api.core.CqlSession getSession() -
setSession
public void setSession(com.datastax.oss.driver.api.core.CqlSession session) -
getTable
-
setTable
-
getTtl
-
setTtl
-
getWriteConsistencyLevel
public com.datastax.oss.driver.api.core.ConsistencyLevel getWriteConsistencyLevel() -
setWriteConsistencyLevel
public void setWriteConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel writeConsistencyLevel) -
getReadConsistencyLevel
public com.datastax.oss.driver.api.core.ConsistencyLevel getReadConsistencyLevel() -
setReadConsistencyLevel
public void setReadConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel readConsistencyLevel) -
getPrefixPKValues
-
setPrefixPKValues
-
getPkColumns
-
setPkColumns
-