Skip to content

Voltdb-procedure

The voltdb-procedure sink passes data to a VoltDB stored procedure. It employs at-least-once delivery guarantees.

For each event it will asynchronously invoke stored procedure passing event data as arguments. When using the Java API the argument to the sink is an array of Object-s that correspond to stored procedure arguments. E.g. to invoke a stored procedure that has public long run(long id, int anotherId, String someString) method the Object[] should contain Long, Integer and String or compatible types as defined in the VoltDB documentation.

In case of downstream system error this sink will retry procedure execution with exponential backoff. The details of this behaviour are configurable using retry configuration that is nested within client configuration.

ProcedureVoltSinkConfigBuilder.builder()
     .addToServers("localhost", 12122)
     .withProcedureName("runMe")
     .withExceptionHandler(...)
 sink:
     voltdb-procedure:
     servers: localhost:12122
     procedureName: runMe

Properties

procedureName

The name of the VoltDB stored procedure to invoke for processing data. Required.

Type: string

servers

A set of host and port addresses for connecting to the VoltDB cluster. Only one address is sufficient for cluster topology discovery. Required.

Type: array

client

Configuration settings for the VoltDB client, including retry policies, transaction limits, and authentication credentials. Type: object

Fields of client:

client.retry

Configuration for retrying failed operations, including the number of retries and backoff delays. Type: object

Fields of client.retry:

client.retry.retries

Number of retry attempts after a request failure. Type: number

Default value: 3

client.retry.backoffDelay

Initial delay before the first retry attempt. Type: object

Default value: PT0.2S

client.retry.maxBackoffDelay

Maximum delay between consecutive retry attempts. Type: object

Default value: PT3S

client.maxTransactionsPerSecond

The maximum number of transactions allowed per second to control the rate of operations. Type: number

client.maxOutstandingTransactions

The maximum number of outstanding transactions allowed, limiting concurrent operations. Type: number

client.requestTimeout

The timeout duration for client requests to VoltDB, after which a request is considered failed. Type: object

client.authUser

The username for authenticating with the VoltDB cluster. Type: string

client.authPassword

The password for authenticating with the VoltDB cluster. Type: string

client.trustStoreFile

The path to the trust store file used for secure connections to VoltDB. Type: string

client.trustStorePassword

The trust store password. Type: string

exceptionHandler

A custom exception handler to process errors that occur during procedure execution. Type: object

Java dependency management

Add this declaration to your dependency management system to access the configuration DSL for this plugin in Java.

<dependency>
    <groupId>org.voltdb</groupId>
    <artifactId>volt-stream-plugin-volt-api</artifactId>
    <version>1.4.0</version>
</dependency>
implementation group: 'org.voltdb', name: 'volt-stream-plugin-volt-api', version: '1.4.0'

Usage Examples

ProcedureVoltSinkConfigBuilder.builder()
   .addToServers("localhost", 12122)
   .withProcedureName("runMe")
   .withClientBuilder(builder -> {
       builder.withMaxOutstandingTransactions(42000);
       builder.withMaxTransactionsPerSecond(23);
       builder.withRequestTimeout(Duration.ofSeconds(5));
       builder.withAuthUser("admin");
       builder.withAuthPassword("admin123");
       builder.withTrustStoreFile("c:/Users32/trust.me");
       builder.withTrustStorePassword("got2have");

       builder.withRetryBuilder(retryBuilder -> {
           retryBuilder.withRetries(4);
           retryBuilder.withBackoffDelay(Duration.ofSeconds(2));
           retryBuilder.withMaxBackoffDelay(Duration.ofSeconds(11));
       });
   })
   .withExceptionHandler(exceptionHandler)
sink:
    voltdb-procedure:
      servers: localhost:12122
      procedureName: runMe
      client:
        maxOutstandingTransactions: 42000
        maxTransactionsPerSecond: 23
        requestTimeout: PT5S
        authUser: admin
        authPassword: admin123
        trustStoreFile: c:/Users32/trust.me
        trustStorePassword: got2have
        retry:
            retries: 4
            backoffDelay: 2s
            maxBackoffDelay: 11s