https://github.com/cdimascio/go-kafka-ibm-message-hub-example
Example using IBM Message Hub Kafka with Go
https://github.com/cdimascio/go-kafka-ibm-message-hub-example
Last synced: 8 months ago
JSON representation
Example using IBM Message Hub Kafka with Go
- Host: GitHub
- URL: https://github.com/cdimascio/go-kafka-ibm-message-hub-example
- Owner: cdimascio
- Created: 2017-01-25T03:48:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-25T03:50:35.000Z (over 9 years ago)
- Last Synced: 2025-08-04T08:37:37.782Z (11 months ago)
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-kafka-ibm-message-hub-example
This sample show how to use IBM Message Hub with GoLang using the sarama kafka client.
## Setup and Run
1. Create an [IBM Message Hub](https://console.ng.bluemix.net/catalog/services/message-hub) Service instance via IBM [Bluemix](https://www.bluemix.net[]())
2. Clone this repo
- `git clone https://github.ibm.com/dimascio/go-kafka-ibm-message-hub-example`
3. Create your own certificate
Generated private key:
`openssl genrsa -out server.key 2048`
To generate a certificate:
`openssl req -new -x509 -key server.key -out server.pem -days 3650`
This will create `server.pem` and a `server.key`
4. `cd ` where `` is where you cloned this repo
5. Copy `server.pem` and a `server.key` to ``
6. Move `message-hub-creds.json.sample` to `message-hub-creds.json`
7. Populate `message-hub-creds.json` with credentials from step 1.
4. Run `go build`
5. Start the consumer.
`go-kafka-ibm-message-hub-example -type=consumer -topic=mytopic`
6. Start the producer
`go-kafka-ibm-message-hub-example -type=producer -topic=mytopic -num=20`