This function is used to push an Adelia REF_CLASS-type variable or ALPHA variable to a Kafka broker, specifying a topic and a key.
This function is executed using a configuration file (in YML format), defining the detailed configuration of the manipulated Adelia logical broker.
Application area
Adelia Cloud client
Event Adelia client
Java server
Java client
Adelia Web client
Parameters
ALPHA(n) | AdeliaKafkaLogicalBroker | Adelia logical broker name. Its parameters (broker, port, etc.) are defined in the AdeliaKafkaConfig.YML configuration file). |
ALPHA(n) | Topic | Name of Kafka topic to send the record to. |
REF_CLASS or ALPHA(n) |
Instance or String | Class or alphanumeric string instance to send. |
ALPHA(n) | Key | Key relating to the record. |
NUM_BIN_4 | ReturnCode | Return code: 0: Successful execution. 1: Exception (internal error during execution), detail of the exception in the second parameter (message relating to the return code). 2: Kafka logical broker not specified. 3: Publication topic not specified. 4: The instance to publish (REF_CLASS variable) is null. 5: Configuration not loaded: no logical broker defined: .YML file not defined, found or loaded. 6: no configuration defined in the .YML file for the specified Adelia Kafka logical broker. |
ALPHA(n) | ReturnMessage | Message detailing the return code. |
Example 1
REF_CLASS(MYCLASS) myInstance
myTopic = 'mytopicadelia'
myKey = '20181205'
CALL_CLASS 'VaToolBx' 'VaToolBxSendToAvroKafkaWithKey' 'myKafkaLogicalBroker' myTopic myInstance myKey myReturnCode myReturnMessage
* myReturnCode is specified
* myReturnMessage is specified
Example 2
ALPHA(123) myMessage
myTopic = 'mytopicadelia'
myMessage = 'message sent from HF1234'myKey = '20181205'
CALL_CLASS 'VaToolBx' 'VaToolBxSendToAvroKafkaWithKey' 'myKafkaLogicalBroker' myTopic myMessage myKey myReturnCode myReturnMessage
* myReturnCode is specified
* myReturnMessage is specified
List of VaToolBx DLL functions by topic