Class JdbcMessageIdRepository
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.processor.idempotent.jdbc.AbstractJdbcMessageIdRepository
org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository
- 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:
JdbcCachedMessageIdRepository
,JdbcOrphanLockAwareIdempotentRepository
@Metadata(label="bean",
description="Idempotent repository that uses a SQL database to store message ids.",
annotations="interfaceName=org.apache.camel.spi.IdempotentRepository")
@Configurer(metadataOnly=true)
public class JdbcMessageIdRepository
extends AbstractJdbcMessageIdRepository
Default implementation of
AbstractJdbcMessageIdRepository
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
Fields inherited from class org.apache.camel.processor.idempotent.jdbc.AbstractJdbcMessageIdRepository
dataSource, jdbcTemplate, log, processorName, transactionTemplate
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
ConstructorDescriptionJdbcMessageIdRepository
(DataSource dataSource, String processorName) JdbcMessageIdRepository
(DataSource dataSource, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName) JdbcMessageIdRepository
(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
delete()
Operations that deletes all the rowsprotected int
Operations that deletes the key if it existsprotected void
doInit()
protected void
doStart()
protected int
Operation that inserts the key if it does not already existboolean
protected int
queryForInt
(String key) Operation that returns the number of rows, if any, for the specified keyvoid
setClearString
(String clearString) void
setCreateString
(String createString) void
setCreateTableIfNotExists
(boolean createTableIfNotExists) void
setDeleteString
(String deleteString) void
setInsertString
(String insertString) void
setQueryString
(String queryString) void
setTableExistsString
(String tableExistsString) void
setTableName
(String tableName) To use a custom table name instead of the default name: CAMEL_MESSAGEPROCESSEDMethods inherited from class org.apache.camel.processor.idempotent.jdbc.AbstractJdbcMessageIdRepository
add, clear, confirm, contains, createTransactionTemplate, doStop, getDataSource, getJdbcTemplate, getProcessorName, getTransactionTemplate, remove, setDataSource, setJdbcTemplate, setProcessorName, setTransactionTemplate
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, 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
-
Field Details
-
DEFAULT_TABLENAME
- See Also:
-
DEFAULT_TABLE_EXISTS_STRING
- See Also:
-
DEFAULT_CREATE_STRING
- See Also:
-
DEFAULT_QUERY_STRING
- See Also:
-
DEFAULT_INSERT_STRING
- See Also:
-
DEFAULT_DELETE_STRING
- See Also:
-
DEFAULT_CLEAR_STRING
- See Also:
-
-
Constructor Details
-
JdbcMessageIdRepository
public JdbcMessageIdRepository() -
JdbcMessageIdRepository
-
JdbcMessageIdRepository
public JdbcMessageIdRepository(DataSource dataSource, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName) -
JdbcMessageIdRepository
public JdbcMessageIdRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
-
Method Details
-
doInit
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStart
- Overrides:
doStart
in classAbstractJdbcMessageIdRepository
- Throws:
Exception
-
queryForInt
Description copied from class:AbstractJdbcMessageIdRepository
Operation that returns the number of rows, if any, for the specified key- Specified by:
queryForInt
in classAbstractJdbcMessageIdRepository
- Parameters:
key
- the key- Returns:
- int number of rows
-
insert
Description copied from class:AbstractJdbcMessageIdRepository
Operation that inserts the key if it does not already exist- Specified by:
insert
in classAbstractJdbcMessageIdRepository
- Parameters:
key
- the key- Returns:
- int number of rows inserted
-
delete
Description copied from class:AbstractJdbcMessageIdRepository
Operations that deletes the key if it exists- Specified by:
delete
in classAbstractJdbcMessageIdRepository
- Parameters:
key
- the key- Returns:
- int number of rows deleted
-
delete
protected int delete()Description copied from class:AbstractJdbcMessageIdRepository
Operations that deletes all the rows- Specified by:
delete
in classAbstractJdbcMessageIdRepository
- Returns:
- int number of rows deleted
-
isCreateTableIfNotExists
public boolean isCreateTableIfNotExists() -
setCreateTableIfNotExists
public void setCreateTableIfNotExists(boolean createTableIfNotExists) -
getTableExistsString
-
setTableExistsString
-
getTableName
-
setTableName
To use a custom table name instead of the default name: CAMEL_MESSAGEPROCESSED -
getCreateString
-
setCreateString
-
getQueryString
-
setQueryString
-
getInsertString
-
setInsertString
-
getDeleteString
-
setDeleteString
-
getClearString
-
setClearString
-