...
Code Block |
---|
public void testHierarchicalTopics () { // create the initial context and connect to FioranoMQ 9 Hashtable env = new Hashtable (); env.put (Context.SECURITY_PRINCIPAL, "anonymous"); env.put (Context.SECURITY_CREDENTIALS, "anonymous"); env.put (Context.PROVIDER_URL, "http://localhost:1856"); env.put Context.INITIAL_CONTEXT_FACTORY,"fiorano.jms.runtime.naming.FioranoInitialContextFactory"); InitialContext ic = new InitialContext (env); System.out.println ("Created InitialContext:: " + ic); MQAdminConnectionFactory acf = (MQAdminConnectionFactory) ic.lookup ("primaryACF"); MQAdminConnection ac = acf.createMQAdminConnection ("admin", "passwd"); System.out.println ("Created Admin Connection..."); MQAdminService adminService = ac.getMQAdminService (); System.out.println ("Received handle to Admin services:: " + adminService); // Create a topic named primaryTopic.subTopic1 String topicName = "primarytopic.subtopic1"; TopicMetaData tMetaData = new TopicMetaData(); tMetaData.setName (topicName); adminService.createTopic (tMetaData); Topic topic = (Topic) ic.lookup (topicName); System.out.println ("Looked up the Hierarchical Topic ", topic.getName()); //create a topic named primarytopic.subtopic2 String topicName = "primarytopic.subtopic2"; TopicMetaData tMetaData = new TopicMetaData (); tMetaData.setName (topicName); adminService.createTopic (tMetaData); topic = (Topic) ic.lookup (topicName); System.out.println ("Looked up the Hierarchical Topic ", topic.getName()); } |
...
eStudio
The User can create Hierarchical Topics with admin StudioeStudio. To create hierarchical topics with studioeStudio, follow the steps below:
- Launch Fiorano StudioeStudio and connect Studio eStudio to the FioranoMQ Server.
- To create a topic, navigate to the Topics sub-node under the Destinations node of the tree
- Right-click the Topics node and select Add Topic
...
Deletion of a topic/subtopic from the hierarchical namespace depends on the value of the parameter AllowDeletionOfSubTopics, which can be configured through Fiorano StudioeStudio. If this value is set to 'true', then deletion of a topic/subtopic deletes all the children of this topic/subtopic. However, if it is set to 'False', the following exception is raised, indicating that the user needs to first delete the children of the topic/subtopic before deleting the topic itself.
...
By default, this variable is set to 'False'. Follow the steps given below to delete a hierarchical topic\subtopic.
- Start Fiorano eeStudio/eStudio/Studio and login to FMQ-JMX
- Select the Topic config from JMX Connection > Fiorano > mq > PubSub > Topic > $(TopicName) > config
- Enable the value of the parameter named AllowDeletionOfSubtopics (GeneralPropeties) by setting it up to 'True' from the drop-down list.
...
- A Hierarchical Topic is not supported by the following flags:
- UseOptimizedTCPReceive = true
- This implies that the Hierarchical Topic is not supported by the 7.2 runtime Layer.
- Un-subscription for Hierarchical topics does not work. The User has to unsubscribe the subscribers created on behalf of hierarchical support manually, through StudioeStudio