Unit Testing Event Publication and Subscription
After you configure Kafka, you need to do preliminary tests to check if the configurations are correct. Sidecar APIs implement consumer and producer application, but Kafka installations also come with simple Consumer and Producer console (command line/shell) applications. You can configure consumer.properties and producer.properties file in Kafka installation, start necessary topics, send a request in the producer console and verify that it appears in the consumer console apps. These tests can ensure that various configurations (for example, SSL configurations) in Kafka and Siebel CRM are correct.
To Test Kafka producer and consumer console test apps
The following changes are to be made in consumer.properties and producer.properties of Kafka for testing communication over SSL:
security.protocol=SSL
ssl.keystore.location=<Fully qualified Siebel Keystore file location>
ssl.keystore.password=<pwd value>
ssl.truststore.location=< Fully qualified Siebel Truststore file location>
ssl.truststore.password=<pwd value>
ssl.key.password=<pwd value>
Sample Windows command to start the Kafka consumer console app from Kafka bin directory:
kafka-console-consumer.bat --topic <name of topic> --bootstrap-server
<fully qualified Kafka server hostname>:9093 --consumer.config
"D:\kafka\config\consumer.properties"
Similarly, to start the Kafka producer console app from Kafka bin directory:
kafka-console-producer.bat --topic <name of topic> --bootstrap-server
<fully qualified Kafka server hostname>:9093 --producer.config
"D:\kafka\config\producer.properties"
To configure SASL/OAUTHBEARER with Event Publication and Subscription for Kafka clients
- Update the following properties in the
producer.properties
andconsumer.properties
files:security.protocol=SASL_PLAINTEXT sasl.mechanism=OAUTHBEARER sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \ clientId=<OAuth client ID> \ clientSecret=<OAuth client secret> \ scope="abcall"; sasl.oauthbearer.token.endpoint.url=<OAuth token URL> sasl.login.callback.handler.class=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginCallbackHandler
-
Configure the JVM parameters using the truststore file and its password at the command prompt where the Kafka client will be started, as follows:
On Windows:
set KAFKA_OPTS=-Djavax.net.ssl.trustStore=oauth2-openssl-truststore.jks - Djavax.net.ssl.trustStorePassword=changeit