You can configure KafkaConsumer, KafkaRead, and KafkaProducer nodes to connect to the Event Streams service in IBM® Cloud.
Before you begin
Read the following topics:
About this task
IBM Event
Streams for IBM Cloud
is a scalable, distributed, high-throughput message bus, which supports a number of client protocols
including Kafka. You can use the KafkaConsumer, KafkaRead, and KafkaProducer nodes in IBM App Connect Enterprise to
receive messages from and send messages to Event Streams.
Before you can connect to Event Streams, you must create a set
of credentials, which the IBM App Connect Enterprise Kafka nodes can then use to make a
connection. You can use either the mqsisetdbparms or
mqsicredentials command to configure the credentials that the
Kafka nodes use to authenticate to Event Streams.
To enable the Kafka nodes to authenticate by using the username and password, you must set the
Security protocol property on the node to SASL_SSL.
For more information about configuring security credentials for connecting to Kafka, see Configuring security credentials for connecting to Kafka.
Procedure
Follow these steps to configure a connection to IBM Event
Streams:
-
Create a set of credentials in Event Streams, which the Kafka
nodes use for the connection.
-
In Event Streams, view the credentials and make a note of the
list of servers in the kafka_brokers_sasl property.
You use this list of servers to populate the
Bootstrap servers property
on the
KafkaConsumer, KafkaRead, and
KafkaProducer nodes when you are creating your message
flow.
You will use the values in the User and Password
fields to configure the security credentials that IBM App Connect Enterprise uses to
connect to Event Streams.
- Use either the mqsisetdbparms or mqsicredentials command to associate a username and password with a
connection to Event Streams:
- Configure security credentials by using the mqsisetdbparms command, specifying the required username
(-u), password (-p), and resource name
(-n). The resource name is in the form
kafka::
followed by the
name of the security identity that is specified on the Kafka node; for example,
kafka::myKafkaSecId
. Alternatively, you can use the default security identity, by
specifying a resource name of kafka::KAFKA
or
kafka::KAFKA::integrationServerName
.The following example shows how to specify a
username, password, and named Kafka security
identity:
mqsisetdbparms -w workDir -n kafka::myKafkaSecId -u myUsername -p myPassword
The
following example hows how to specify a username and password, and specifies that the default Kafka
security identity for the integration server will be used for connecting to
Event Streams:
mqsisetdbparms -w workDir -n kafka::KAFKA::myIntegrationServer1 -u myUsername -p myPassword
For
more information, see mqsisetdbparms command.
- Configure security credentials by using the mqsicredentials command, specifying the username
(--username), password (--password), credential type
(--credential-type), and credential name
(--credential-name). Specify the credential type as
kafka
, and
specify a credential name that matches the value of the Security identifier
parameter specified in the node. Alternatively, you can use the default security identity specified
by the --set-as-default parameter on the mqsicredentials command. The following example shows how to specify
a username, password, and named Kafka security
identity:
mqsicredentials --create --work-dir workDir --credential-type kafka --credential-name myKafkaSecId --username myUsername --password myPassword
The
following example shows how to specify a username and password, and specifies that the default Kafka
security identity for the integration server will be used for connecting to
Event Streams:
mqsicredentials --create --work-dir workDir --credential-type kafka --credential-name myKafkaSecId --username myUsername --password myPassword
mqsicredentials --set-as-default --work-dir workDir --credential-type kafka --credential-name myKafkaSecId
For
more information, see mqsicredentials command.
-
On the Security tab of the Kafka nodes, set the Security protocol property to SASL_SSL, and set the SSL protocol
property to TLSv1.2.
If the username and password that are to be used for connecting to Event Streams were configured by using the mqsicredentials command, specify the Security
identifier property on the Kafka node, which will be used to access those credentials in
the App Connect Enterprise vault.
What to do next
You can use the mqsireportdbparms command or the mqsicredentials command to show
information about the credentials that are being used for connecting to Event Streams.
For more information about the Kafka nodes, see the following topics: