Interface SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder

  • All Superinterfaces:
    org.apache.camel.builder.EndpointConsumerBuilder, org.apache.camel.EndpointConsumerResolver
    All Known Subinterfaces:
    SqlEndpointBuilderFactory.SqlEndpointBuilder
    Enclosing interface:
    SqlEndpointBuilderFactory

    public static interface SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder
    extends org.apache.camel.builder.EndpointConsumerBuilder
    Builder for endpoint consumers for the SQL component.
    • Method Detail

      • allowNamedParameters

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder allowNamedParameters​(boolean allowNamedParameters)
        Whether to allow using named parameters in the queries. The option is a: <code>boolean</code> type. Default: true Group: common
        Parameters:
        allowNamedParameters - the value to set
        Returns:
        the dsl builder
      • allowNamedParameters

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder allowNamedParameters​(String allowNamedParameters)
        Whether to allow using named parameters in the queries. The option will be converted to a <code>boolean</code> type. Default: true Group: common
        Parameters:
        allowNamedParameters - the value to set
        Returns:
        the dsl builder
      • dataSource

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder dataSource​(DataSource dataSource)
        Sets the DataSource to use to communicate with the database at endpoint level. The option is a: <code>javax.sql.DataSource</code> type. Group: common
        Parameters:
        dataSource - the value to set
        Returns:
        the dsl builder
      • dataSource

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder dataSource​(String dataSource)
        Sets the DataSource to use to communicate with the database at endpoint level. The option will be converted to a <code>javax.sql.DataSource</code> type. Group: common
        Parameters:
        dataSource - the value to set
        Returns:
        the dsl builder
      • outputClass

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder outputClass​(String outputClass)
        Specify the full package and class name to use as conversion when outputType=SelectOne. The option is a: <code>java.lang.String</code> type. Group: common
        Parameters:
        outputClass - the value to set
        Returns:
        the dsl builder
      • outputHeader

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder outputHeader​(String outputHeader)
        Store the query result in a header instead of the message body. By default, outputHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If outputHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. The option is a: <code>java.lang.String</code> type. Group: common
        Parameters:
        outputHeader - the value to set
        Returns:
        the dsl builder
      • outputType

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder outputType​(org.apache.camel.component.sql.SqlOutputType outputType)
        Make the output of consumer or producer to SelectList as List of Map, or SelectOne as single Java object in the following way: a) If the query has only single column, then that JDBC Column object is returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long object. b) If the query has more than one column, then it will return a Map of that result. c) If the outputClass is set, then it will convert the query result into an Java bean object by calling all the setters that match the column names. It will assume your class has a default constructor to create instance with. d) If the query resulted in more than one rows, it throws an non-unique result exception. StreamList streams the result of the query using an Iterator. This can be used with the Splitter EIP in streaming mode to process the ResultSet in streaming fashion. The option is a: <code>org.apache.camel.component.sql.SqlOutputType</code> type. Default: SelectList Group: common
        Parameters:
        outputType - the value to set
        Returns:
        the dsl builder
      • outputType

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder outputType​(String outputType)
        Make the output of consumer or producer to SelectList as List of Map, or SelectOne as single Java object in the following way: a) If the query has only single column, then that JDBC Column object is returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long object. b) If the query has more than one column, then it will return a Map of that result. c) If the outputClass is set, then it will convert the query result into an Java bean object by calling all the setters that match the column names. It will assume your class has a default constructor to create instance with. d) If the query resulted in more than one rows, it throws an non-unique result exception. StreamList streams the result of the query using an Iterator. This can be used with the Splitter EIP in streaming mode to process the ResultSet in streaming fashion. The option will be converted to a <code>org.apache.camel.component.sql.SqlOutputType</code> type. Default: SelectList Group: common
        Parameters:
        outputType - the value to set
        Returns:
        the dsl builder
      • separator

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder separator​(char separator)
        The separator to use when parameter values is taken from message body (if the body is a String type), to be inserted at # placeholders. Notice if you use named parameters, then a Map type is used instead. The default value is comma. The option is a: <code>char</code> type. Default: , Group: common
        Parameters:
        separator - the value to set
        Returns:
        the dsl builder
      • separator

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder separator​(String separator)
        The separator to use when parameter values is taken from message body (if the body is a String type), to be inserted at # placeholders. Notice if you use named parameters, then a Map type is used instead. The default value is comma. The option will be converted to a <code>char</code> type. Default: , Group: common
        Parameters:
        separator - the value to set
        Returns:
        the dsl builder
      • breakBatchOnConsumeFail

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder breakBatchOnConsumeFail​(boolean breakBatchOnConsumeFail)
        Sets whether to break batch if onConsume failed. The option is a: <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        breakBatchOnConsumeFail - the value to set
        Returns:
        the dsl builder
      • breakBatchOnConsumeFail

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder breakBatchOnConsumeFail​(String breakBatchOnConsumeFail)
        Sets whether to break batch if onConsume failed. The option will be converted to a <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        breakBatchOnConsumeFail - the value to set
        Returns:
        the dsl builder
      • bridgeErrorHandler

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder bridgeErrorHandler​(boolean bridgeErrorHandler)
        Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. The option is a: <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        bridgeErrorHandler - the value to set
        Returns:
        the dsl builder
      • bridgeErrorHandler

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder bridgeErrorHandler​(String bridgeErrorHandler)
        Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. The option will be converted to a <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        bridgeErrorHandler - the value to set
        Returns:
        the dsl builder
      • expectedUpdateCount

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder expectedUpdateCount​(int expectedUpdateCount)
        Sets an expected update count to validate when using onConsume. The option is a: <code>int</code> type. Default: -1 Group: consumer
        Parameters:
        expectedUpdateCount - the value to set
        Returns:
        the dsl builder
      • expectedUpdateCount

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder expectedUpdateCount​(String expectedUpdateCount)
        Sets an expected update count to validate when using onConsume. The option will be converted to a <code>int</code> type. Default: -1 Group: consumer
        Parameters:
        expectedUpdateCount - the value to set
        Returns:
        the dsl builder
      • maxMessagesPerPoll

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder maxMessagesPerPoll​(int maxMessagesPerPoll)
        Sets the maximum number of messages to poll. The option is a: <code>int</code> type. Group: consumer
        Parameters:
        maxMessagesPerPoll - the value to set
        Returns:
        the dsl builder
      • maxMessagesPerPoll

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder maxMessagesPerPoll​(String maxMessagesPerPoll)
        Sets the maximum number of messages to poll. The option will be converted to a <code>int</code> type. Group: consumer
        Parameters:
        maxMessagesPerPoll - the value to set
        Returns:
        the dsl builder
      • onConsume

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder onConsume​(String onConsume)
        After processing each row then this query can be executed, if the Exchange was processed successfully, for example to mark the row as processed. The query can have parameter. The option is a: <code>java.lang.String</code> type. Group: consumer
        Parameters:
        onConsume - the value to set
        Returns:
        the dsl builder
      • onConsumeBatchComplete

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder onConsumeBatchComplete​(String onConsumeBatchComplete)
        After processing the entire batch, this query can be executed to bulk update rows etc. The query cannot have parameters. The option is a: <code>java.lang.String</code> type. Group: consumer
        Parameters:
        onConsumeBatchComplete - the value to set
        Returns:
        the dsl builder
      • onConsumeFailed

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder onConsumeFailed​(String onConsumeFailed)
        After processing each row then this query can be executed, if the Exchange failed, for example to mark the row as failed. The query can have parameter. The option is a: <code>java.lang.String</code> type. Group: consumer
        Parameters:
        onConsumeFailed - the value to set
        Returns:
        the dsl builder
      • routeEmptyResultSet

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder routeEmptyResultSet​(boolean routeEmptyResultSet)
        Sets whether empty resultset should be allowed to be sent to the next hop. Defaults to false. So the empty resultset will be filtered out. The option is a: <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        routeEmptyResultSet - the value to set
        Returns:
        the dsl builder
      • routeEmptyResultSet

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder routeEmptyResultSet​(String routeEmptyResultSet)
        Sets whether empty resultset should be allowed to be sent to the next hop. Defaults to false. So the empty resultset will be filtered out. The option will be converted to a <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        routeEmptyResultSet - the value to set
        Returns:
        the dsl builder
      • sendEmptyMessageWhenIdle

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder sendEmptyMessageWhenIdle​(boolean sendEmptyMessageWhenIdle)
        If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. The option is a: <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        sendEmptyMessageWhenIdle - the value to set
        Returns:
        the dsl builder
      • sendEmptyMessageWhenIdle

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder sendEmptyMessageWhenIdle​(String sendEmptyMessageWhenIdle)
        If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. The option will be converted to a <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        sendEmptyMessageWhenIdle - the value to set
        Returns:
        the dsl builder
      • transacted

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder transacted​(boolean transacted)
        Enables or disables transaction. If enabled then if processing an exchange failed then the consumer breaks out processing any further exchanges to cause a rollback eager. The option is a: <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        transacted - the value to set
        Returns:
        the dsl builder
      • transacted

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder transacted​(String transacted)
        Enables or disables transaction. If enabled then if processing an exchange failed then the consumer breaks out processing any further exchanges to cause a rollback eager. The option will be converted to a <code>boolean</code> type. Default: false Group: consumer
        Parameters:
        transacted - the value to set
        Returns:
        the dsl builder
      • useIterator

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder useIterator​(boolean useIterator)
        Sets how resultset should be delivered to route. Indicates delivery as either a list or individual object. defaults to true. The option is a: <code>boolean</code> type. Default: true Group: consumer
        Parameters:
        useIterator - the value to set
        Returns:
        the dsl builder
      • useIterator

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder useIterator​(String useIterator)
        Sets how resultset should be delivered to route. Indicates delivery as either a list or individual object. defaults to true. The option will be converted to a <code>boolean</code> type. Default: true Group: consumer
        Parameters:
        useIterator - the value to set
        Returns:
        the dsl builder
      • backoffErrorThreshold

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder backoffErrorThreshold​(int backoffErrorThreshold)
        The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. The option is a: <code>int</code> type. Group: scheduler
        Parameters:
        backoffErrorThreshold - the value to set
        Returns:
        the dsl builder
      • backoffErrorThreshold

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder backoffErrorThreshold​(String backoffErrorThreshold)
        The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. The option will be converted to a <code>int</code> type. Group: scheduler
        Parameters:
        backoffErrorThreshold - the value to set
        Returns:
        the dsl builder
      • backoffIdleThreshold

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder backoffIdleThreshold​(int backoffIdleThreshold)
        The number of subsequent idle polls that should happen before the backoffMultipler should kick-in. The option is a: <code>int</code> type. Group: scheduler
        Parameters:
        backoffIdleThreshold - the value to set
        Returns:
        the dsl builder
      • backoffIdleThreshold

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder backoffIdleThreshold​(String backoffIdleThreshold)
        The number of subsequent idle polls that should happen before the backoffMultipler should kick-in. The option will be converted to a <code>int</code> type. Group: scheduler
        Parameters:
        backoffIdleThreshold - the value to set
        Returns:
        the dsl builder
      • backoffMultiplier

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder backoffMultiplier​(int backoffMultiplier)
        To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured. The option is a: <code>int</code> type. Group: scheduler
        Parameters:
        backoffMultiplier - the value to set
        Returns:
        the dsl builder
      • backoffMultiplier

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder backoffMultiplier​(String backoffMultiplier)
        To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured. The option will be converted to a <code>int</code> type. Group: scheduler
        Parameters:
        backoffMultiplier - the value to set
        Returns:
        the dsl builder
      • delay

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder delay​(long delay)
        Milliseconds before the next poll. The option is a: <code>long</code> type. Default: 500 Group: scheduler
        Parameters:
        delay - the value to set
        Returns:
        the dsl builder
      • greedy

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder greedy​(boolean greedy)
        If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages. The option is a: <code>boolean</code> type. Default: false Group: scheduler
        Parameters:
        greedy - the value to set
        Returns:
        the dsl builder
      • greedy

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder greedy​(String greedy)
        If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages. The option will be converted to a <code>boolean</code> type. Default: false Group: scheduler
        Parameters:
        greedy - the value to set
        Returns:
        the dsl builder
      • initialDelay

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder initialDelay​(long initialDelay)
        Milliseconds before the first poll starts. The option is a: <code>long</code> type. Default: 1000 Group: scheduler
        Parameters:
        initialDelay - the value to set
        Returns:
        the dsl builder
      • initialDelay

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder initialDelay​(String initialDelay)
        Milliseconds before the first poll starts. The option will be converted to a <code>long</code> type. Default: 1000 Group: scheduler
        Parameters:
        initialDelay - the value to set
        Returns:
        the dsl builder
      • repeatCount

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder repeatCount​(long repeatCount)
        Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever. The option is a: <code>long</code> type. Default: 0 Group: scheduler
        Parameters:
        repeatCount - the value to set
        Returns:
        the dsl builder
      • repeatCount

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder repeatCount​(String repeatCount)
        Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever. The option will be converted to a <code>long</code> type. Default: 0 Group: scheduler
        Parameters:
        repeatCount - the value to set
        Returns:
        the dsl builder
      • runLoggingLevel

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder runLoggingLevel​(org.apache.camel.LoggingLevel runLoggingLevel)
        The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that. The option is a: <code>org.apache.camel.LoggingLevel</code> type. Default: TRACE Group: scheduler
        Parameters:
        runLoggingLevel - the value to set
        Returns:
        the dsl builder
      • runLoggingLevel

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder runLoggingLevel​(String runLoggingLevel)
        The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that. The option will be converted to a <code>org.apache.camel.LoggingLevel</code> type. Default: TRACE Group: scheduler
        Parameters:
        runLoggingLevel - the value to set
        Returns:
        the dsl builder
      • scheduledExecutorService

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder scheduledExecutorService​(ScheduledExecutorService scheduledExecutorService)
        Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. The option is a: <code>java.util.concurrent.ScheduledExecutorService</code> type. Group: scheduler
        Parameters:
        scheduledExecutorService - the value to set
        Returns:
        the dsl builder
      • scheduledExecutorService

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder scheduledExecutorService​(String scheduledExecutorService)
        Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. The option will be converted to a <code>java.util.concurrent.ScheduledExecutorService</code> type. Group: scheduler
        Parameters:
        scheduledExecutorService - the value to set
        Returns:
        the dsl builder
      • scheduler

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder scheduler​(Object scheduler)
        To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler. The option is a: <code>java.lang.Object</code> type. Default: none Group: scheduler
        Parameters:
        scheduler - the value to set
        Returns:
        the dsl builder
      • scheduler

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder scheduler​(String scheduler)
        To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler. The option will be converted to a <code>java.lang.Object</code> type. Default: none Group: scheduler
        Parameters:
        scheduler - the value to set
        Returns:
        the dsl builder
      • schedulerProperties

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder schedulerProperties​(String key,
                                                                                         Object value)
        To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. The option is a: <code>java.util.Map&lt;java.lang.String, java.lang.Object&gt;</code> type. The option is multivalued, and you can use the schedulerProperties(String, Object) method to add a value (call the method multiple times to set more values). Group: scheduler
        Parameters:
        key - the option key
        value - the option value
        Returns:
        the dsl builder
      • schedulerProperties

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder schedulerProperties​(Map values)
        To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. The option is a: <code>java.util.Map&lt;java.lang.String, java.lang.Object&gt;</code> type. The option is multivalued, and you can use the schedulerProperties(String, Object) method to add a value (call the method multiple times to set more values). Group: scheduler
        Parameters:
        values - the values
        Returns:
        the dsl builder
      • startScheduler

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder startScheduler​(boolean startScheduler)
        Whether the scheduler should be auto started. The option is a: <code>boolean</code> type. Default: true Group: scheduler
        Parameters:
        startScheduler - the value to set
        Returns:
        the dsl builder
      • startScheduler

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder startScheduler​(String startScheduler)
        Whether the scheduler should be auto started. The option will be converted to a <code>boolean</code> type. Default: true Group: scheduler
        Parameters:
        startScheduler - the value to set
        Returns:
        the dsl builder
      • timeUnit

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder timeUnit​(TimeUnit timeUnit)
        Time unit for initialDelay and delay options. The option is a: <code>java.util.concurrent.TimeUnit</code> type. Default: MILLISECONDS Group: scheduler
        Parameters:
        timeUnit - the value to set
        Returns:
        the dsl builder
      • timeUnit

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder timeUnit​(String timeUnit)
        Time unit for initialDelay and delay options. The option will be converted to a <code>java.util.concurrent.TimeUnit</code> type. Default: MILLISECONDS Group: scheduler
        Parameters:
        timeUnit - the value to set
        Returns:
        the dsl builder
      • useFixedDelay

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder useFixedDelay​(boolean useFixedDelay)
        Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details. The option is a: <code>boolean</code> type. Default: true Group: scheduler
        Parameters:
        useFixedDelay - the value to set
        Returns:
        the dsl builder
      • useFixedDelay

        default SqlEndpointBuilderFactory.SqlEndpointConsumerBuilder useFixedDelay​(String useFixedDelay)
        Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details. The option will be converted to a <code>boolean</code> type. Default: true Group: scheduler
        Parameters:
        useFixedDelay - the value to set
        Returns:
        the dsl builder