Kafka Client Adapter

The Kafka Client Adapter connects with a Kafka queue to push and pull documents.

The following table provides an overview of the Kafka Client Adapter:

System name Kafka Client Adapter
Description This adapter is used to connect with a Kafka messaging queue to exchange business documents.
Business usage Use this adapter to send or receive documents to a trading partner using Kafka.
Usage example The Sterling B2B Integrator business process must send a document to a Kafka queue. The business process passes the document as well as information about the connection to the Kafka Client adapter. Using the information provided in the business process, the Kafka Client adapter connects to the Kafka queue and transfers the document, enforcing any security specifications from the business process.
Preconfigured? No
Requires third-party files? No
Platform availability All Sterling B2B Integrator supported platforms
Related services Related services:
  • Kafka Begin Session Service
  • Kafka Consumer Service
  • Kafka Producer Service
  • Kafka End Session Service
Application requirements A Kafka server.
Initiates business processes? This service does not initiate business processes.
Invocation This service is invoked from a business process.
Restrictions N/A
Persistence level Default
Testing considerations Test this service by running the KafkaClientDemoAllServices business process provided with Sterling B2B Integrator. This business process tests the Kafka Client adapter and all its related services.

Configuring the Kafka Client Adapter

To configure the Kafka Client adapter, you must specify field settings in Sterling B2B Integrator:

Field Description
Name Name this service will have in Sterling B2B Integrator. Required.
Description Description of service. Required.
Environment Nodes where the Kafka Client adapter is deployed. The values are - nodes in the cluster, adapter containers, All ASI nodes, All ASI nodes plus all Adapter Container Nodes, and All Adapter Container Nodes. To scale the Kafka Client adapter as and when new nodes are added to the cluster, the options All ASI nodes, All ASI nodes plus all Adapter Container Nodes, and All Adapter Container Nodes are introduced.
Select a Group Select one of the options:
  • None – You do not want to include this configuration in a group at this time. (default)
  • Create New Group – You can enter a name for a new group in this field, which will then be created along with this configuration.
  • Select Group – If you have already created one or more groups for this service type, they are displayed in the list. Select a group from the list.
Note: For more information about groups, see Managing Services and Adapters.
Minimum Number of Threads A tuning parameter that indicates the range of threads available for handling events to improve performance. Must be less than or equal to Max Threads value. Valid value is any integer. Default is 3. Required.
Maximum Number of Threads A tuning parameter that indicates the range of threads available for handling events to improve performance. Must be greater than or equal to Min Threads value. Valid value is any integer. Default is 6. Required.
Topic Topic to which the Kafka Client Adapter connects.
BootStrapServers A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. This list should be in the form: host1:port1,host2:port2,....
Kafka Action Select the Kafka Action for which the adapter is configured.
  1. Kafka Producer Config
  2. Kafka Consumer Config
GroupId A unique string that identifies the consumer group this consumer belongs to. Required.
SecurityAction Protocol used to communicate with brokers. Valid values are PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL.
SASLMechanism SASL mechanism used for client connections. This may be any mechanism for which a security provider is available.
SASLJaasConfig JAAS login context parameters for SASL connections in the format used by JAAS configuration files. JAAS configuration file format is described here: JAAS Login Configuration File.
For example,
listener.name.sasl_ssl.scram-sha-256.sasl.jaas.config=com.example.ScramLoginModule required;
KafkaClientAdapter Select the Kafka Client adapter for this service to use when beginning sessions with a Kafka server. Required.
TrustStorePath The location of the trust store file.
TrustStorePassword The password for the trust store file.
KeyStorePath The location of the key store file. This is optional for client and can be used for two-way authentication for client.
KeyStorePassword The store password for the key store file.
ProducerConfig Sequence of additional producer configurations as needed for the producer. For more information, see Producer Configs.
For example,
  • Property Name: buffer.memory
  • Property Value: 102400
  • Property Name: compression.type
  • Property Value: gzip
ConsumerConfig Similar to ProducerConfig this is used for additional configurations required for the Kafka Consumer. For more information, see Consumer Configs.
KeySerializer Serializer class for key that implements the org.apache.kafka.common.serialization.Serializer interface.
ValueSerializer Serializer class for value that implements the org.apache.kafka.common.serialization.Serializer interface.
KeyDeserializer Deserializer class for key that implements the org.apache.kafka.common.serialization.Deserializer interface.
ValueDeserializer Deserializer class for value that implements the org.apache.kafka.common.serialization.Deserializer interface.
StorageType Type of storage required for the document to be stored at. It can be File System, Database or Object Store. Required for ConsumerConfig only.
Timeout (Millisecond) The maximum amount of time the client will wait for the response of a request (in milliseconds).
TLSVersion Select the TLS version from the drop-down menu. Valid values are:
  • TLSv1.2
  • TLSv1.3
Note: The field TLSVersion is only available on Sterling B2B Integrator v6.2.0.2 and above.
Note: To configure the SSL/SASL files for Certified Containers, Kafka client truststore, keystore and Jaas configuration files can be copied under volume mapped to /ibm/resources. It is the same volume that is used as persistent volume for appResourcesPVC section in values.yaml.
For example, while specifying the paths in the BPs:
/ibm/resources/kafka.client.truststore.jks