Scenario 2: Viewing message flow across a cluster

You can configure a publish/subscribe mechanism to verify the flow of messages across yourEclipse Amlen cluster by using the Messaging Tester Sample Application and a demonstration MQTT endpoint called DemoMqttEndpoint. DemoMqttEndpoint allows applications to connect to Eclipse Amlen on port 1883, and from any configured IP address.

Background to this scenario

This scenario uses a sample application and a demonstration endpoint to verify the flow of messages across a cluster. You can add publishers and subscribers to generate publications on and subscriptions to one or more topics. Use this publish/subscribe method to watch messages flow across your cluster.

For cluster environments, all servers need to publish and subscribe on the same topics. To configure this scenario, you must provide a TopicRoot, and use the same TopicRoot for each of your three browser instances. For example, MarkSmith/TopicA. If another person wants to use the Messaging Tester Sample Application with the same cluster members, they must use a different TopicRoot so that their messages are published to a different topic tree. For example, JoeBrown/TopicA.

Planning and implementing the scenario

Use the following information to help you plan and implement your Eclipse Amlen cluster by using REST Administration APIs.

Understanding the clustering architecture

In this scenario, three servers are configured as a cluster. You can use the same configuration that is described in Scenario 1. This scenario tests that the cluster can deliver directives and responses and have them display correctly on other nodes of the cluster.

Setting up your cluster for this scenario

You can configure your Eclipse Amlen cluster by using REST Administration APIs. For information about setting up your cluster for this scenario, see Configuring your environment for the cluster scenarios.

Testing the scenario

  1. Open an Internet Explorer 11, Firefox, or Chrome browser and connect to the Eclipse Amlen Web UI by entering the following URL: https://{Server IP}:9087.
  2. Click the Messaging tab and select Sample Application from the menu. The Messaging Tester Sample Application page is displayed.
  3. Follow the instructions on the Messaging Tester Sample Application page to download and set up the latest version of the Messaging Tester Sample Application. This version of the Messaging Tester Sample Application supports clustering.
  4. Enable the DemoMqttEndpoint on port 1883 on all three servers.
  5. Launch an instance of the Messaging Tester Sample Application in a separate browser instance for each member of the cluster. For each cluster member complete the following steps:
    1. Enter the server IP address, port number, and a TopicRoot.
      Note: Use the same TopicRoot for all three instances of the application. The TopicRoot is prepended to the TopicName to create a unique topic for each user of the messaging tester application. For example, MarkSmith/TopicA. The TopicRoot is required so that multiple instances of the messaging tester application that are running against the same server or servers, do not interfere with each other. If TopicRoot is not specified, a unique TopicRoot is automatically generated for each browser instance. Automatic generation of a unique TopicRoot means that the scenario runs successfully if your application is running against a single server.
      For example specify the following values:
      • On browser instance 1:

        IP: 10.10.33.10
        Port: 1883
        TopicRoot: MyTopic

      • On browser instance 2:

        IP: 10.10.33.11
        Port: 1883
        TopicRoot: MyTopic

      • On browser instance 3:

        IP: 10.10.33.12
        Port: 1883
        TopicRoot: MyTopic

    2. Click Connect. The Web Client is now connected to your server.

Next steps

After you have successfully connected each of your three Web Clients to your configured servers, you can set up publishers and subscribers on one or more a topics and watch messages flow across the cluster.

  1. Scenario A:
    1. Add a publisher on Topic A on Web Client 1.
    2. Add subscribers to Topic A on Web Client 2 and 3.
    3. View the flow of messages that are published by Web Client 1 to Eclipse Amlen Server 1. These messages are received by Web Client 2 and 3, even though these Web Clients are connected to the different Eclipse Amlen servers.
  2. Scenario B:
    1. Add a publisher on Topic A on Web Client 2.
    2. View that the number of messages being received by Web Client 2 and Web Client 3 doubles. This is because messages from two different servers are being sent to subscribers on two different servers. Messages that are published by Web Client 2 to Eclipse Amlen Server 2 go directly to the local subscriber on Web Client 2.
  3. Scenario C:
    1. Add and remove publishers and subscribers on other topics for each Web Client.
    2. View the flow of messages across the cluster, verifying that you see the messages flow as you expect them to.