12.5. Invoking the Compound Procedure

Documentation

VoltDB Home » Documentation » Guide to Performance and Customization

12.5. Invoking the Compound Procedure

The primary use case for compound procedures is processing incoming topics. Therefore, the common way to initiate the procedure is to name it as part of the topic definition in the configuration. You do this using the deployment.topics.topic[].procedure property. For example, to associate the example compound procedure defined in this chapter with the BasicMessage topic, the configuration looks like this:

deployment:
  topics:
    topic:
    - name: BasicMessage
      procedure: ProcessMessage

Similarly, you can use compound procedures as the target for import connectors. For example, the following configuration associates the compound procedure to a topic from an external Kafka server:

deployment:
  import:
    configuration:
    - nickname: basicimport
      type: kafka
      enabled: true
      property:
      - name: brokers
        value: mykafkasvr:9092
      - name: topics
        value: BasicMessage
      - name: procedure
        value: ProcessMessage

When declared as the target of an inbound topic or import connector, the compound procedure is invoked once for every record received. You can also generate individual invocations of the procedure in the same way you do any other stored procedure: programmatically (such as with the Java callProcedure method) or manually through the sqlcmd EXEC directive:

$ sqlcmd
1> exec ProcessMessage 123 "This is a test";