This Node.js console application demonstrates how to connect to IBM Message Hub, send and receive messages using the node-rdkafka module. It also shows how to create and list topics using the Message Hub Admin REST API.
It can be run locally on your machine or deployed into IBM Cloud®.
In this tutorial, we'll focus on deploying the application into the IBM Cloud, therefore you don't have to build it locally, it will be done on your behalf on IBM Cloud.
Important Note: This sample creates on your behalf a topic named kafka-nodejs-console-sample-topic
with one partition - this will incur a fee if the topic does not already exist on your account.
To run the sample, you must have done the following:
- Obtain this repository's contents, either use
git
or just download the samples as a ZIP - Message Hub Service Instance provisioned in IBM Cloud®
- Cloud Foundry Command Line Interface installed
It's important to know which Message Hub plan you're using as the sample deployment steps are subtly different on each plan respectively.
By this point, you should have a Message Hub instance provisioned. If you haven't done this step yet, please refer to the main readme.
If you are not sure what type of Message Hub instance you have then you can find this information out by visiting IBM Cloud's web console dashboard.
Please make sure you are in the appropriate Region, Account, Organization and Space where you provisioned your Message Hub instance!
- Message Hub Standard plan services are "Cloud Foundry Services" with the plan column showing "Standard".
- Message Hub Enterprise plan services are "Services" with the plan column showing "Enterprise".
As the Standard and Enterprise Plan deployment steps are subtly different, we split the deployment steps into separate sections. Please navigate to the appropriate page(s):