How to Receive a Notification from the IBM Message Hub

Java SDK

import static java.lang.System.out;

import java.util.Arrays;
import java.util.Properties;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;

public final class IbmCloudSample {

  public static void main(final String[] args) {
    final Properties props = new Properties();

    props.put("bootstrap.servers", "host:9093");

    props.put("", "true");

    props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

    props.put("security.protocol", "SASL_SSL");

    props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

    final KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);


    while (true) {
      final ConsumerRecords<String, String> records = consumer.poll(1000);

      for (final ConsumerRecord<String, String> record : records)





KafkaClient { required

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.