How to Send a Notification to the IBM Message Hub with Java

import java.util.Properties;

import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;

public final class MessageHubSample {

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

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

    props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");

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

    props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");

    final Producer<String, String> producer = new KafkaProducer<>(props);

    producer.send(new ProducerRecord<String, String>("SampleTopic", "Sample Message"));




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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s