Retrieve Kafka Messages from within a Production
InterSystems IRIS becomes a Kafka Consumer when an interoperability production includes a business service that uses the Kafka inbound adapter. This adapter allows the business service to retrieve messages (as Kafka message objects) from a Kafka topic. You have two options when using a production as a Kafka Consumer: use a built-in business service that leverages the inbound adapter or build your own business service that uses the adapter.
Built-in Business Service
Rather than building a custom business service that uses the inbound adapter, you can simply add EnsLib.Kafka.ServiceOpens in a new tab to the production and define the adapter properties using the Management Portal settings. As the business service retrieves messages from Kafka at the interval determined by the Basic Settings > Call Interval setting, these messages are forwarded to another business host in the production using asynchronous requests. The business host where these requests are forwarded is determined by the Basic Settings > Target Config Names setting.
For basic information about adding a business service to a production, see Adding Business Hosts.
The Kafka inbound adapter is the class EnsLib.Kafka.InboundAdapterOpens in a new tab. It includes the following settings, all of which appear in the Management Portal as settings for the business service that uses the adapter:
Servers defines a comma-separated list of IP address:port entries that identify servers in the Kafka cluster.
Topic defines the Kafka topic from which the Consumer is retrieving messages.
GroupID defines the ID of the Consumer's consumer group.
ReceiveSettings (optional) a JSON string defining settings for message retrieval. The list of available settings is the same as the list of properties made available by the Kafka API KafkaReceiveSettings class, with each property name serving as the key.
Credentials defines the InterSystems credentials that correspond to the username and password of a Kafka client. For details on creating credentials, see Defining Reusable Items for Use in Settings.
For general information about building a custom business service that uses an inbound adapter, see Defining Business Services.
Using the Kafka Messaging API (for use without a production)