How to Send a Notification to IBM MQ Light with Java

import com.ibm.mqlight.api.ClientOptions;
import com.ibm.mqlight.api.NonBlockingClient;
import com.ibm.mqlight.api.NonBlockingClientAdapter;

public final class MqLightSample2 {

  public static void main(final String[] args) {
    NonBlockingClient.create("amqp://host:1912", ClientOptions.builder().setCredentials("username", "password").build(), new NonBlockingClientAdapter<Void>() {

        public void onStarted(final NonBlockingClient client, final Void context) {
          client.send("SampleTopic", "Sample Message", null);
        }

      }, null);
  }

}

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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