HornetQ Deploying a Distributed Topic

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

This article explains how to deploy a distributed topic - meaning that messages are internally distributed amongst the HornetQ nodes that have the topic deployed on them. The underlying cluster connection that does the internal message distribution is configured to only handle messages destined to the specific topic we're distributing, maintaining all other destinations isolated.

The example assumes three nodes (n1, n2 and n3).

Deploy the Topic on All Nodes

Deploy the topic on all nodes. Use the usual declaration:

<jms-destinations>
  ...
  <jms-topic name="novaordis">
    <entry name="topic/novaordis"/>
    <entry name="java:jboss/exported/topic/novaordis"/>
  </jms-topic>
</jms-destinations>

At this point, the topic is deployed locally on all three nodes. Topic subscriptions will only receive messages sent to the topic on the node the subscription was established on.

Configure the Cluster Connection on All Nodes

Deploy the cluster connection that will distribute topic messages among nodes:



Some content on gold