Class CassandraEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.support.ScheduledPollEndpoint
org.apache.camel.component.cassandra.CassandraEndpoint
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.ComponentAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.15.0",
scheme="cql",
title="Cassandra CQL",
syntax="cql:beanRef:hosts:port/keyspace",
category={DATABASE,BIGDATA},
headersClass=CassandraConstants.class)
public class CassandraEndpoint
extends org.apache.camel.support.ScheduledPollEndpoint
Integrate with Cassandra 2.0+ using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by
DataStax.
-
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
ConstructorsConstructorDescriptionCassandraEndpoint
(String endpointUri, org.apache.camel.Component component) CassandraEndpoint
(String uri, CassandraComponent component, com.datastax.oss.driver.api.core.CqlSession session, String keyspace) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.Consumer
createConsumer
(org.apache.camel.Processor processor) org.apache.camel.Producer
protected com.datastax.oss.driver.api.core.CqlSessionBuilder
protected void
doStart()
protected void
doStop()
protected void
fillMessage
(com.datastax.oss.driver.api.core.cql.ResultSet resultSet, org.apache.camel.Message message) Copy ResultSet into Message.getBean()
Deprecated.com.datastax.oss.driver.api.core.ConsistencyLevel
getCql()
To use a specific comma separated list of Extra Type codecs.getHosts()
To use a specific LoadBalancingPolicyClassgetPort()
com.datastax.oss.driver.api.core.CqlSession
protected CassandraSessionHolder
boolean
protected com.datastax.oss.driver.api.core.cql.PreparedStatement
Create and configure a Prepared CQL statementprotected com.datastax.oss.driver.api.core.cql.PreparedStatement
prepareStatement
(String cql) Create and configure a Prepared CQL statementvoid
Instead of using a hostname:port, refer to an existing configured Session or Cluster from the Camel registry to be used.void
setBeanRef
(String beanRef) Deprecated.void
setClusterName
(String clusterName) Cluster namevoid
setConsistencyLevel
(com.datastax.oss.driver.api.core.DefaultConsistencyLevel consistencyLevel) Consistency level to usevoid
CQL query to perform.void
setDatacenter
(String datacenter) Datacenter to usevoid
setExtraTypeCodecs
(String extraTypeCodecs) void
Hostname(s) Cassandra server(s).void
setKeyspace
(String keyspace) Keyspace to usevoid
setLoadBalancingPolicyClass
(String loadBalancingPolicyClass) void
setPassword
(String password) Password for session authenticationvoid
Port number of Cassandra server(s)void
setPrepareStatements
(boolean prepareStatements) Whether to use PreparedStatements or regular Statementsvoid
setResultSetConversionStrategy
(ResultSetConversionStrategy resultSetConversionStrategy) To use a custom class that implements logic for converting ResultSet into message body ALL, ONE, LIMIT_10, LIMIT_100...void
setSession
(com.datastax.oss.driver.api.core.CqlSession session) To use the Session instance (you would normally not use this option)void
setUsername
(String username) Username for session authenticationMethods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureExchange, configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, 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, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.ComponentAware
getComponent
Methods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducer
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
-
CassandraEndpoint
-
CassandraEndpoint
public CassandraEndpoint(String uri, CassandraComponent component, com.datastax.oss.driver.api.core.CqlSession session, String keyspace)
-
-
Method Details
-
createProducer
- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
Exception
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
getSessionHolder
-
createSessionBuilder
protected com.datastax.oss.driver.api.core.CqlSessionBuilder createSessionBuilder() -
prepareStatement
Create and configure a Prepared CQL statement -
prepareStatement
protected com.datastax.oss.driver.api.core.cql.PreparedStatement prepareStatement()Create and configure a Prepared CQL statement -
fillMessage
protected void fillMessage(com.datastax.oss.driver.api.core.cql.ResultSet resultSet, org.apache.camel.Message message) Copy ResultSet into Message. -
getBean
-
setBean
Instead of using a hostname:port, refer to an existing configured Session or Cluster from the Camel registry to be used. -
getBeanRef
Deprecated. -
setBeanRef
Deprecated. -
getHosts
-
setHosts
Hostname(s) Cassandra server(s). Multiple hosts can be separated by comma. -
getPort
-
setPort
Port number of Cassandra server(s) -
getKeyspace
-
setKeyspace
Keyspace to use -
getDatacenter
-
setDatacenter
Datacenter to use -
getCql
-
setCql
CQL query to perform. Can be overridden with the message header with key CamelCqlQuery. -
getSession
public com.datastax.oss.driver.api.core.CqlSession getSession() -
setSession
public void setSession(com.datastax.oss.driver.api.core.CqlSession session) To use the Session instance (you would normally not use this option) -
getClusterName
-
setClusterName
Cluster name -
getUsername
-
setUsername
Username for session authentication -
getPassword
-
setPassword
Password for session authentication -
getConsistencyLevel
public com.datastax.oss.driver.api.core.ConsistencyLevel getConsistencyLevel() -
setConsistencyLevel
public void setConsistencyLevel(com.datastax.oss.driver.api.core.DefaultConsistencyLevel consistencyLevel) Consistency level to use -
getResultSetConversionStrategy
-
setResultSetConversionStrategy
To use a custom class that implements logic for converting ResultSet into message body ALL, ONE, LIMIT_10, LIMIT_100... -
isPrepareStatements
public boolean isPrepareStatements() -
setPrepareStatements
public void setPrepareStatements(boolean prepareStatements) Whether to use PreparedStatements or regular Statements -
getLoadBalancingPolicyClass
To use a specific LoadBalancingPolicyClass -
setLoadBalancingPolicyClass
-
getExtraTypeCodecs
To use a specific comma separated list of Extra Type codecs. Possible values are: BLOB_TO_ARRAY, BOOLEAN_LIST_TO_ARRAY, BYTE_LIST_TO_ARRAY, SHORT_LIST_TO_ARRAY, INT_LIST_TO_ARRAY, LONG_LIST_TO_ARRAY, FLOAT_LIST_TO_ARRAY, DOUBLE_LIST_TO_ARRAY, TIMESTAMP_UTC, TIMESTAMP_MILLIS_SYSTEM, TIMESTAMP_MILLIS_UTC, ZONED_TIMESTAMP_SYSTEM, ZONED_TIMESTAMP_UTC, ZONED_TIMESTAMP_PERSISTED, LOCAL_TIMESTAMP_SYSTEM and LOCAL_TIMESTAMP_UTC -
setExtraTypeCodecs
-