You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2013/09/27 08:03:23 UTC
git commit: since most of the brokers doesn't support dynamic topics
creation,
we should specify the topics in jndi.properties file and then lookup from the
context
Updated Branches:
refs/heads/master 67141af7b -> a4d7a072a
since most of the brokers doesn't support dynamic topics creation, we should specify the topics in jndi.properties file and then lookup from the context
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/a4d7a072
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/a4d7a072
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/a4d7a072
Branch: refs/heads/master
Commit: a4d7a072a36c2e2d3e695f6967cafed302a60331
Parents: 67141af
Author: Nirmal Fernando <ni...@apache.org>
Authored: Fri Sep 27 11:31:59 2013 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Fri Sep 27 11:31:59 2013 +0530
----------------------------------------------------------------------
.../lb/common/mb/heartbeat/TopicHealthChecker.java | 15 ++++++++++++++-
.../lb/common/mb/subscribe/TopicSubscriber.java | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a4d7a072/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/heartbeat/TopicHealthChecker.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/heartbeat/TopicHealthChecker.java b/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/heartbeat/TopicHealthChecker.java
index 91492ad..2bac487 100644
--- a/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/heartbeat/TopicHealthChecker.java
+++ b/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/heartbeat/TopicHealthChecker.java
@@ -32,12 +32,17 @@ import org.apache.stratos.lb.common.mb.connect.TopicConnector;
public class TopicHealthChecker implements Runnable{
private static final Log log = LogFactory.getLog(TopicHealthChecker.class);
+ private String topicName;
+ public TopicHealthChecker(String topic) {
+ setTopicName(topic);
+ }
+
@Override
public void run() {
log.info("Topic Health Checker is running... ");
- TopicConnector testConnector = new TopicConnector();
+ TopicConnector testConnector = new TopicConnector(getTopicName());
while (true) {
try {
// health checker runs in every 30s
@@ -65,4 +70,12 @@ public class TopicHealthChecker implements Runnable{
}
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public void setTopicName(String topicName) {
+ this.topicName = topicName;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a4d7a072/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/subscribe/TopicSubscriber.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/subscribe/TopicSubscriber.java b/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/subscribe/TopicSubscriber.java
index 99678f2..e755e3c 100644
--- a/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/subscribe/TopicSubscriber.java
+++ b/components/org.apache.stratos.lb.common/src/main/java/org/apache/stratos/lb/common/mb/subscribe/TopicSubscriber.java
@@ -91,7 +91,7 @@ public class TopicSubscriber implements Runnable {
e);
} finally {
// start the health checker
- Thread healthChecker = new Thread(new TopicHealthChecker());
+ Thread healthChecker = new Thread(new TopicHealthChecker(topicName));
healthChecker.start();
try {
// waits till the thread finishes.