- namspace = topicName.substring(0, topicName.lastIndexOf("."));
- ins = namspace + ".topic";
- type = ":topic." + topicName;
+
+ if (action.equals("create")) {
+ String instancePart = (System.getenv("msgRtr.topicfactory.aaf") != null)
+ ? System.getenv("msgRtr.topicfactory.aaf")
+ : "org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:";
+ String[] instandType = (instancePart + namspace + "|create").split("|");
+ ins = instandType[0];
+ type = instandType[1];
+ } else if (action.equals("pub") || action.equals("sub")) {
+ namspace = topicName.substring(0, topicName.lastIndexOf("."));
+ String instancePart = (System.getenv("pubSubInstPart") != null) ? System.getenv("pubSubInstPart")
+ : ".topic";
+ ins = namspace + instancePart;
+ type = ":topic." + topicName;
+ }