You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/kafka/nodejs-kafka/README.adoc
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,7 @@ To enable your Node.js application to access a Kafka instance, you must configur
141
141
* The generated credentials for your {product-kafka} service account
142
142
* The Simple Authentication and Security Layer (SASL) mechanism that the client will use to authenticate with the Kafka instance
143
143
144
-
In this task, you'll create a new configuration file called `.env`. In this file, you'll set the required bootstrap server and client credentials as environment variables.
144
+
In this task, you'll create a new configuration file called `rhoas.env`. In this file, you'll set the required bootstrap server and client credentials as environment variables.
145
145
146
146
.Prerequisites
147
147
ifndef::qs[]
@@ -152,16 +152,16 @@ endif::[]
152
152
153
153
.Procedure
154
154
155
-
. In your IDE, create a new file. Save the file with the name `.env`, at the root level of the `reactive-example` directory for the cloned repository.
155
+
. In your IDE, create a new file. Save the file with the name `rhoas.env`, at the root level of the `reactive-example` directory for the cloned repository.
156
156
157
-
. In the `.env` file, add the lines shown in the example. These lines set the bootstrap server and client credentials as environment variables to be used by the Node.js application.
157
+
. In the `rhoas.env` file, add the lines shown in the example. These lines set the bootstrap server and client credentials as environment variables to be used by the Node.js application.
158
158
+
159
-
.Setting environment variables in the .env file
159
+
.Setting environment variables in the rhoas.env file
160
160
[source,subs="+quotes"]
161
161
----
162
-
KAFKA_BOOTSTRAP_SERVER=__<bootstrap_server>__
163
-
KAFKA_CLIENT_ID=__<client_id>__
164
-
KAFKA_CLIENT_SECRET=__<client_secret>__
162
+
KAFKA_HOST=__<bootstrap_server>__
163
+
RHOAS_CLIENT_ID=__<client_id>__
164
+
RHOAS_CLIENT_SECRET=__<client_secret>__
165
165
KAFKA_SASL_MECHANISM=plain
166
166
----
167
167
+
@@ -179,7 +179,7 @@ endif::[]
179
179
+
180
180
In this case, observe that the Node.js application uses the SASL/PLAIN authentication method (that is, the value of `KAFKA_SASL_MECHANISM` is set to `plain`). This means that the application uses only the client ID and client secret to authenticate with the Kafka instance. The application doesn't require an authentication token.
181
181
182
-
. Save the `.env` file.
182
+
. Save the `rhoas.env` file.
183
183
184
184
ifdef::qs[]
185
185
.Verification
@@ -334,11 +334,11 @@ NOTE: You can also use the {product-long-kafka} web console to browse messages i
334
334
335
335
. In your IDE, in the `producer-backend` directory of the repository that you cloned, open the `producer.js` file.
336
336
+
337
-
Observe that the producer component is configured to process environment variables from the `.env` file that you created. The component used the bootstrap server endpoint and client credentials stored in this file to connect to the Kafka instance.
337
+
Observe that the producer component is configured to process environment variables from the `rhoas.env` file that you created. The component used the bootstrap server endpoint and client credentials stored in this file to connect to the Kafka instance.
338
338
339
339
. In the `consumer-backend` directory, open the `consumer.js` file.
340
340
+
341
-
Observe that the consumer component is also configured to process environment variables from the `.env` file that you created.
341
+
Observe that the consumer component is also configured to process environment variables from the `rhoas.env` file that you created.
0 commit comments