10.5. Invoking the Compound Procedure

The primary use case for compound procedures is processing incoming streams. Therefore, the common way to initiate the procedure is to name it as part of the import definition in the configuration. 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 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';