Interface SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
-
- All Superinterfaces:
org.apache.camel.builder.EndpointConsumerBuilder
,org.apache.camel.EndpointConsumerResolver
- All Known Subinterfaces:
SoroushBotEndpointBuilderFactory.SoroushBotEndpointBuilder
- Enclosing interface:
- SoroushBotEndpointBuilderFactory
public static interface SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder extends org.apache.camel.builder.EndpointConsumerBuilder
Builder for endpoint consumers for the Soroush component.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default SoroushBotEndpointBuilderFactory.AdvancedSoroushBotEndpointConsumerBuilder
advanced()
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
authorizationToken(String authorizationToken)
The authorization token for using the bot.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
backOffStrategy(String backOffStrategy)
The strategy to backoff in case of connection failure.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
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.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
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.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
concurrentConsumers(int concurrentConsumers)
Number of Thread created by consumer in the route.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
concurrentConsumers(String concurrentConsumers)
Number of Thread created by consumer in the route.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
connectionTimeout(int connectionTimeout)
Connection timeout in ms when connecting to soroush API.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
connectionTimeout(String connectionTimeout)
Connection timeout in ms when connecting to soroush API.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
maxConnectionRetry(int maxConnectionRetry)
Maximum connection retry when fail to connect to soroush API, if the quota is reached, MaximumConnectionRetryReachedException is thrown for that message.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
maxConnectionRetry(String maxConnectionRetry)
Maximum connection retry when fail to connect to soroush API, if the quota is reached, MaximumConnectionRetryReachedException is thrown for that message.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
maxRetryWaitingTime(long maxRetryWaitingTime)
Maximum amount of time (in millisecond) a thread wait before retrying failed request.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
maxRetryWaitingTime(String maxRetryWaitingTime)
Maximum amount of time (in millisecond) a thread wait before retrying failed request.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
queueCapacityPerThread(int queueCapacityPerThread)
Maximum capacity of each queue when concurrentConsumers is greater than 1.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
queueCapacityPerThread(String queueCapacityPerThread)
Maximum capacity of each queue when concurrentConsumers is greater than 1.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
reconnectIdleConnectionTimeout(long reconnectIdleConnectionTimeout)
The timeout in millisecond to reconnect the existing getMessage connection to ensure that the connection is always live and does not dead without notifying the bot.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
reconnectIdleConnectionTimeout(String reconnectIdleConnectionTimeout)
The timeout in millisecond to reconnect the existing getMessage connection to ensure that the connection is always live and does not dead without notifying the bot.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
retryExponentialCoefficient(long retryExponentialCoefficient)
Coefficient to compute back off time when using Exponential Back Off strategy.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
retryExponentialCoefficient(String retryExponentialCoefficient)
Coefficient to compute back off time when using Exponential Back Off strategy.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
retryLinearIncrement(long retryLinearIncrement)
The amount of time (in millisecond) which adds to waiting time when using Linear back off strategy.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
retryLinearIncrement(String retryLinearIncrement)
The amount of time (in millisecond) which adds to waiting time when using Linear back off strategy.default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
retryWaitingTime(long retryWaitingTime)
Waiting time before retry failed request (Millisecond).default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder
retryWaitingTime(String retryWaitingTime)
Waiting time before retry failed request (Millisecond).
-
-
-
Method Detail
-
advanced
default SoroushBotEndpointBuilderFactory.AdvancedSoroushBotEndpointConsumerBuilder advanced()
-
connectionTimeout
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder connectionTimeout(int connectionTimeout)
Connection timeout in ms when connecting to soroush API. The option is a: <code>int</code> type. Default: 30000 Group: common- Parameters:
connectionTimeout
- the value to set- Returns:
- the dsl builder
-
connectionTimeout
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder connectionTimeout(String connectionTimeout)
Connection timeout in ms when connecting to soroush API. The option will be converted to a <code>int</code> type. Default: 30000 Group: common- Parameters:
connectionTimeout
- the value to set- Returns:
- the dsl builder
-
maxConnectionRetry
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder maxConnectionRetry(int maxConnectionRetry)
Maximum connection retry when fail to connect to soroush API, if the quota is reached, MaximumConnectionRetryReachedException is thrown for that message. The option is a: <code>int</code> type. Default: 4 Group: common- Parameters:
maxConnectionRetry
- the value to set- Returns:
- the dsl builder
-
maxConnectionRetry
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder maxConnectionRetry(String maxConnectionRetry)
Maximum connection retry when fail to connect to soroush API, if the quota is reached, MaximumConnectionRetryReachedException is thrown for that message. The option will be converted to a <code>int</code> type. Default: 4 Group: common- Parameters:
maxConnectionRetry
- the value to set- Returns:
- the dsl builder
-
bridgeErrorHandler
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder 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 SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder 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
-
concurrentConsumers
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder concurrentConsumers(int concurrentConsumers)
Number of Thread created by consumer in the route. if you use this method for parallelism, it is guaranteed that messages from same user always execute in the same thread and therefore messages from the same user are processed sequentially. Default value notice: using SoroushBotSingleThreadConsumer. The option is a: <code>int</code> type. Default: 1 Group: consumer- Parameters:
concurrentConsumers
- the value to set- Returns:
- the dsl builder
-
concurrentConsumers
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder concurrentConsumers(String concurrentConsumers)
Number of Thread created by consumer in the route. if you use this method for parallelism, it is guaranteed that messages from same user always execute in the same thread and therefore messages from the same user are processed sequentially. Default value notice: using SoroushBotSingleThreadConsumer. The option will be converted to a <code>int</code> type. Default: 1 Group: consumer- Parameters:
concurrentConsumers
- the value to set- Returns:
- the dsl builder
-
queueCapacityPerThread
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder queueCapacityPerThread(int queueCapacityPerThread)
Maximum capacity of each queue when concurrentConsumers is greater than 1. if a queue become full, every message that should go to that queue will be dropped. If bridgeErrorHandler is set to true, an exchange with CongestionException is directed to ErrorHandler. You can then processed the error using onException(CongestionException.class) route. Default value notice: infinite capacity. The option is a: <code>int</code> type. Default: 0 Group: consumer- Parameters:
queueCapacityPerThread
- the value to set- Returns:
- the dsl builder
-
queueCapacityPerThread
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder queueCapacityPerThread(String queueCapacityPerThread)
Maximum capacity of each queue when concurrentConsumers is greater than 1. if a queue become full, every message that should go to that queue will be dropped. If bridgeErrorHandler is set to true, an exchange with CongestionException is directed to ErrorHandler. You can then processed the error using onException(CongestionException.class) route. Default value notice: infinite capacity. The option will be converted to a <code>int</code> type. Default: 0 Group: consumer- Parameters:
queueCapacityPerThread
- the value to set- Returns:
- the dsl builder
-
backOffStrategy
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder backOffStrategy(String backOffStrategy)
The strategy to backoff in case of connection failure. Currently 3 strategies are supported: 1. Exponential (default): It multiply retryWaitingTime by retryExponentialCoefficient after each connection failure. 2. Linear: It increase retryWaitingTime by retryLinearIncrement after each connection failure. 3. Fixed: Always use retryWaitingTime as the time between retries. The option is a: <code>java.lang.String</code> type. Default: Exponential Group: scheduling- Parameters:
backOffStrategy
- the value to set- Returns:
- the dsl builder
-
maxRetryWaitingTime
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder maxRetryWaitingTime(long maxRetryWaitingTime)
Maximum amount of time (in millisecond) a thread wait before retrying failed request. The option is a: <code>long</code> type. Default: 3600000 Group: scheduling- Parameters:
maxRetryWaitingTime
- the value to set- Returns:
- the dsl builder
-
maxRetryWaitingTime
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder maxRetryWaitingTime(String maxRetryWaitingTime)
Maximum amount of time (in millisecond) a thread wait before retrying failed request. The option will be converted to a <code>long</code> type. Default: 3600000 Group: scheduling- Parameters:
maxRetryWaitingTime
- the value to set- Returns:
- the dsl builder
-
reconnectIdleConnectionTimeout
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder reconnectIdleConnectionTimeout(long reconnectIdleConnectionTimeout)
The timeout in millisecond to reconnect the existing getMessage connection to ensure that the connection is always live and does not dead without notifying the bot. this value should not be changed. The option is a: <code>long</code> type. Default: 300000 Group: scheduling- Parameters:
reconnectIdleConnectionTimeout
- the value to set- Returns:
- the dsl builder
-
reconnectIdleConnectionTimeout
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder reconnectIdleConnectionTimeout(String reconnectIdleConnectionTimeout)
The timeout in millisecond to reconnect the existing getMessage connection to ensure that the connection is always live and does not dead without notifying the bot. this value should not be changed. The option will be converted to a <code>long</code> type. Default: 300000 Group: scheduling- Parameters:
reconnectIdleConnectionTimeout
- the value to set- Returns:
- the dsl builder
-
retryExponentialCoefficient
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder retryExponentialCoefficient(long retryExponentialCoefficient)
Coefficient to compute back off time when using Exponential Back Off strategy. The option is a: <code>long</code> type. Default: 2 Group: scheduling- Parameters:
retryExponentialCoefficient
- the value to set- Returns:
- the dsl builder
-
retryExponentialCoefficient
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder retryExponentialCoefficient(String retryExponentialCoefficient)
Coefficient to compute back off time when using Exponential Back Off strategy. The option will be converted to a <code>long</code> type. Default: 2 Group: scheduling- Parameters:
retryExponentialCoefficient
- the value to set- Returns:
- the dsl builder
-
retryLinearIncrement
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder retryLinearIncrement(long retryLinearIncrement)
The amount of time (in millisecond) which adds to waiting time when using Linear back off strategy. The option is a: <code>long</code> type. Default: 10000 Group: scheduling- Parameters:
retryLinearIncrement
- the value to set- Returns:
- the dsl builder
-
retryLinearIncrement
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder retryLinearIncrement(String retryLinearIncrement)
The amount of time (in millisecond) which adds to waiting time when using Linear back off strategy. The option will be converted to a <code>long</code> type. Default: 10000 Group: scheduling- Parameters:
retryLinearIncrement
- the value to set- Returns:
- the dsl builder
-
retryWaitingTime
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder retryWaitingTime(long retryWaitingTime)
Waiting time before retry failed request (Millisecond). If backOffStrategy is not Fixed this is the based value for computing back off waiting time. the first retry is always happen immediately after failure and retryWaitingTime do not apply to the first retry. The option is a: <code>long</code> type. Default: 1000 Group: scheduling- Parameters:
retryWaitingTime
- the value to set- Returns:
- the dsl builder
-
retryWaitingTime
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder retryWaitingTime(String retryWaitingTime)
Waiting time before retry failed request (Millisecond). If backOffStrategy is not Fixed this is the based value for computing back off waiting time. the first retry is always happen immediately after failure and retryWaitingTime do not apply to the first retry. The option will be converted to a <code>long</code> type. Default: 1000 Group: scheduling- Parameters:
retryWaitingTime
- the value to set- Returns:
- the dsl builder
-
authorizationToken
default SoroushBotEndpointBuilderFactory.SoroushBotEndpointConsumerBuilder authorizationToken(String authorizationToken)
The authorization token for using the bot. if uri path does not contain authorization token, this token will be used. The option is a: <code>java.lang.String</code> type. Group: security- Parameters:
authorizationToken
- the value to set- Returns:
- the dsl builder
-
-