remkohdev
  • Learn to Code
  • About Me
  • CI/CD
    • DevOps101
      • Welcome
  • OpenShift
    • Setup OpenShift
      • Setup Minishift
    • Builds
      • Source-to-Image (S2I)
        • Setup S2I
        • Build, Run, Deploy from Source
      • Jenkins Pipeline
    • Jenkins as a Service
      • Setup Jenkins on Openshift
      • Create a Pipeline for Java Spring Boot
  • Istio
    • Setup Istio on IKS
      • Login to IKS
    • Setup Istio on Openshift 3.11
    • Traffic Shifts with a VirtualService
    • Telemetry of Metrics using Prometheus
    • Telemetry of Distributed Tracing using Jaeger
    • Security with Mutual TLS (mTLS)
  • Apache Kafka
    • Setup Apache Kafka on IBM Cloud
    • Setup Apache Kafka on OpenShift
    • Produce and Consume Streams with Kafka Console Tools
    • Produce and Consume Streams with Spring Boot
    • Using the Event Streams CLI
    • Kafka Admin API
  • API Connect
    • APIC CLI
      • Manage API Lifecycle with apic
    • Securing your API
      • Setup AppID
      • Setup API Connect
      • Optional: Add Node-RED Test Server
      • Add 3rd Party OAuth OIDC
        • Create a Custom AppID API
        • Add a Security Definition to your API
Powered by GitBook
On this page

Was this helpful?

  1. Apache Kafka

Using the Event Streams CLI

The IBM Event Streams service provides a managed instance of Apache Kafka on IBM Cloud. IBM Event Streams comes with an Event Streams plugin for the IBM Developer Tools CLI.

Install the Event Streams plugin

$ ibmcloud plugin install event-streams

$ ibmcloud plugin install event-streams
Looking up 'event-streams' from repository 'IBM Cloud'...
Plug-in 'event-streams 2.0.0' found in repository 'IBM Cloud'
Attempting to download the binary file...
 30.95 MiB / 30.95 MiB [===========================================] 100.00% 17s
32455568 bytes downloaded
Installing binary...
OK
Plug-in 'event-streams 2.0.0' was successfully installed into /Users/user1/.bluemix/plugins/event-streams. 
Use 'ibmcloud plugin show event-streams' to show its details.

Initialize the Event Streams plugin

$ ibmcloud es init

$ ibmcloud es init
API Endpoint: https://abcde1fghijk23lm.svc01.us-south.eventstreams.cloud.ibm.com
OK

Login to IBM Cloud

$ ibmcloud login -a cloud.ibm.com
$ ibmcloud target --cf
$ ibmcloud target -g default

Create an Event Streams Instance

$ ibmcloud resource service-instance-create <instance-name> messagehub enterprise|standard <region>

$ ibmcloud resource service-instance-create remkohdev-eventstreams messagehub standard us-south
Creating service instance remkohdev-eventstreams in resource group default of account REMKOHDEV's Account as user1@email.com...
OK
Service instance remkohdev-eventstreams was created.
                 
Name:         remkohdev-eventstreams   
ID:           crn:v1:bluemix:public:messagehub:us-south:a/1ab2c3de456789fg01h23i4j5k6l78mn:12a34bc5-de67-8f9g-h012-34i567jk8901::   
GUID:         12a34bc5-de67-8f9g-h012-34i567jk8901   
Location:     us-south   
State:        active   
Type:         service_instance   
Sub Type:        
Created at:   2019-10-17T15:04:16Z   
Updated at:   2019-10-17T15:04:16Z

Create an API Key for the Event Streams Instance

$ ibmcloud resource service-key-create <key-name> <role-name> --instance-name <instance-name>

Role names include: Manager, Writer, and Reader.

$ ibmcloud resource service-key-create $USERNAME-kafka-eventstreams-credentials1 Manager --instance-name $USERNAME-kafka-eventstreams

Create a Topic

$ ibmcloud es topic-create greetings -p 1

$ ibmcloud es topic-create greetings
Created topic greetings
OK

Display Topic Details

$ ibmcloud es topic greetings

$ ibmcloud es topic greetings
Details for topic greetings
Topic name   Internal?   Partition count   Replication factor   
greetings    false       1                 3   

Partition details for topic greetings
Partition ID   Leader   Replicas   In-sync   
0              0        [0 4 5]    [0 4 5]   

Configuration parameters for topic greetings
Name                  Value   
cleanup.policy        delete   
min.insync.replicas   2   
segment.bytes         536870912   
retention.ms          86400000   
retention.bytes       1073741824

PreviousProduce and Consume Streams with Spring BootNextKafka Admin API

Last updated 5 years ago

Was this helpful?