Skip to content

update readme with some more info, like this....  #1

@markparz

Description

@markparz

Installing Kafka Transaction driver

Create a Kafka / Eventstreams development instance. I used IBM's Cloud Pak for Integration's EventStreams
NOTE ** If you use Cloud Pak for Integration the quickstart deployment will not work.
Create a topic ... we use mosparz
Go to "connect to this cluster"
Generate a scram-user... we use scram-user as the user name
Copy the scram-user password and put it in the kafkaproducer.js file as 'sasl.password'
Download the .pem file

Get the Kafka listener and credentials, next to the scram you just generated. Should look like this:
kafka-dev-kafka-bootstrap-cp4i.marks-kafka2-1e3af63cfXXXXXXXX98d645120e18baf-0000.us-south.containers.appdomain.cloud:443
use this in the kafkaproducer.js as the metadata.broker.list

Clone(this repo) https://github.com/bmos299/TYSKafKaSample

run:

npm install node-rdkafka

replace the es-cert.pem in the directory with the one you downloaded above

You need to use node version 12.13.1 or you will see the error noted at the bottom of this readme

Use 2 terminal windows. in the first
run

node kafkaconsumer.js

NOTE: see below if you get a node error, sometimes the machine resets itself to a bad node version.

In the second terminal you have the option to run a single message or multiple

For a single message run

node kafkaproducer_single_message.js

For a several messages, run

node kafkaproducer_multiple_message.js

Once your run one of the producers you should see a message come across with some values and says "Message I want to send Barry"

This means you have successfully sent a message thru the Kafka queues and back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions