A distributed topic is a set of physical JMS topic members. As such, a distributed topic can be used to create a
TopicSubscriber. The fact that a distributed topic represents multiple physical topics is mostly transparent to the application.
Note: Durable subscribers (
DurableTopicSubscriber) cannot be created for distributed topics. However, you can still create a durable subscription on distributed topic member and the other topic members will forward the messages to the topic member that has the durable subscription.
The topic members can be located anywhere but must all be served either by a single WebLogic Server or any number of servers in a cluster. When a message is sent to a distributed topic, it is sent to all of the topic members in the distributed topic set. This allows all subscribers to the distributed topic to receive messages published for the distributed topic.
Create two managed servers (MS1 and MS2) and assign it to cluster (Cluster).
Create two JMS Server (JMSServer-0 and JMSServer-1) and assign it to each managed servers (MS1 and MS2).
Create JMS module and target it to cluster.
Create a JMS connection factory (ConnectionFactory1) and target it to cluster.
Create a Distributed Topic (MyDistributedTopic) and target it to the cluster.
Check the jndi tree for connection factory and distributed topic.
Use the TopicSend and TopicReceive Program to send and receive messages.
You can find the programs here
Change the JNDI Name of the ConnectionFactory and the Topic.
Send message to distributed topic
java TopicSend t3://xxxx.xxxx.com:7003,xxxx.xxxx.com:7005
Receive message from the topic
java TopicReceive t3://xxxx.xxxx.com:7003,xxxx.xxxx.com:7005
Please refer this post for more details.