Apache Kafka Solver API
Last updated
Last updated
DecisionRules.io supports asynchronous calls to the Rule Solver. This option should be used if your infrastructure is based on asynchronous message processing.
Kafka Solver API is now available both in the cloud and on premise.
In the cloud, it is necessary to enable Kafka Solver for a specific customer manually. If you are interested, please contact us at sales@decisionrules.io
Request access rights for your client application to the DecisionRules Kafka Cluster at sales@decisionrules.io
Configure the connection of your client application to the Kafka cluster.
Register on the assigned Kafka topic, where you will receive the results.
Sending input data to the input Kafka Topic, from which DecisionRules takes it.
Key | Value |
---|---|
broker | pkc-lq8v7.eu-central-1.aws.confluent.cloud:9092 |
ssl | true |
sasl.mechanism | plain |
sasl.username | contact us on sales@decisionrules.io |
sasl.password | contact us on sales@decisionrules.io |
Java Configuration
DecisionRules.io always uses two Kafka topics to communicate with the client application.
Response Topic (read-only)
Topic on which your client application listens
You will receive the evaluated data in this topic
Request Topic (write)
Kafka Topic into which you write data for evaluating DecisionRules
DecisionRules is listening on this topic
Name | Example Topic Name | Permissions |
---|---|---|
Request Topic | {company}-{random_number}-request | WRITE |
Response Topic | {company}-{random_number}-response | READ |
Header | Description |
---|---|
api-key | (mandatory) |
rule-id OR ruleflow-id | (mandatory) Rule or RuleFlow ID |
x-correlation-id | (optional) User-generated ID to help you correlate input and output data. |
version | (optional) Version of the rule you want to solve. |
Message Attribute | Description |
---|---|
Key | <empty> |
Value | JSON object filled according to the data model called by Rule or RuleFlow |
Attribute | Type | Description |
---|---|---|
data | Array | Field filled with data according to the rule evaluation. One element in the array means one result. For example, if multiple rows are matched when evaluating a decision table, they are returned as array items |
errors | Array | If an error occurs in the evaluation for any reason, each error is added to the error field. If there are no errors in the evaluation, the "errors" attribute is not returned. The contents of the "data" field will be empty when any error is returned. |
correlationId | String | (optional) If the "x-correlation-id" header was filled in the input message, this value is available in the output message. If "x-correlation-id" is not filled in the input, the attribute is not present in the output. |
Solver API Key. Generate your api key in the