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
@@ -135,7 +135,7 @@ To enable your Node.js application to access a Kafka instance, you must configur
135
135
* The generated credentials for your {product-kafka} service account
136
136
* The Simple Authentication and Security Layer (SASL) mechanism that the client will use to authenticate with the Kafka instance
137
137
138
-
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.
138
+
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.
139
139
140
140
.Prerequisites
141
141
ifndef::qs[]
@@ -146,16 +146,16 @@ endif::[]
146
146
147
147
.Procedure
148
148
149
-
. 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.
149
+
. 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.
150
150
151
-
. 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.
151
+
. 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.
152
152
+
153
-
.Setting environment variables in the rhoas.env file
153
+
.Setting environment variables in the .env file
154
154
[source,subs="+quotes"]
155
155
----
156
-
KAFKA_HOST=__<bootstrap_server>__
157
-
RHOAS_CLIENT_ID=__<client_id>__
158
-
RHOAS_CLIENT_SECRET=__<client_secret>__
156
+
KAFKA_BOOTSTRAP_SERVER=__<bootstrap_server>__
157
+
KAFKA_CLIENT_ID=__<client_id>__
158
+
KAFKA_CLIENT_SECRET=__<client_secret>__
159
159
KAFKA_SASL_MECHANISM=plain
160
160
----
161
161
+
@@ -173,7 +173,7 @@ endif::[]
173
173
+
174
174
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.
175
175
176
-
. Save the `rhoas.env` file.
176
+
. Save the `.env` file.
177
177
178
178
ifdef::qs[]
179
179
.Verification
@@ -328,11 +328,11 @@ NOTE: You can also use the {product-long-kafka} web console to browse messages i
328
328
329
329
. In your IDE, in the `producer-backend` directory of the repository that you cloned, open the `producer.js` file.
330
330
+
331
-
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.
331
+
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.
332
332
333
333
. In the `consumer-backend` directory, open the `consumer.js` file.
334
334
+
335
-
Observe that the consumer component is also configured to process environment variables from the `rhoas.env` file that you created.
335
+
Observe that the consumer component is also configured to process environment variables from the `.env` file that you created.
0 commit comments