diff --git a/pom.xml b/pom.xml index ed4df7b..48072c9 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ UTF-8 2.8.4 - 4.1.6.RELEASE + 4.3.17.RELEASE 3.4.6 0.1 2.5.0 @@ -25,7 +25,7 @@ 1.2.2 5.1.30 1.0.14 - 2.3.3 + 2.5.0 4.11 16.0.1 @@ -204,6 +204,30 @@ jackson-core com.fasterxml.jackson.core + + spring-expression + org.springframework + + + spring-aop + org.springframework + + + spring-beans + org.springframework + + + spring-context + org.springframework + + + spring-core + org.springframework + + + spring-web + org.springframework + @@ -215,31 +239,114 @@ org.springframework spring-webmvc ${spring.version} + + + spring-expression + org.springframework + + org.springframework spring-web ${spring.version} + + + spring-aop + org.springframework + + org.springframework.security spring-security-web 3.2.8.RELEASE + + + spring-expression + org.springframework + + + spring-aop + org.springframework + + + spring-beans + org.springframework + + + spring-context + org.springframework + + + spring-core + org.springframework + + + spring-web + org.springframework + + org.springframework.security spring-security-config 3.2.8.RELEASE + + + spring-aop + org.springframework + + + spring-beans + org.springframework + + + spring-context + org.springframework + + + spring-core + org.springframework + + + + + org.springframework + spring-context + 4.3.17.RELEASE + + + org.springframework + spring-core + 4.3.17.RELEASE + + + org.springframework + spring-beans + 4.3.17.RELEASE org.apache.zookeeper zookeeper ${zookeeper.version} + + + junit + junit + + com.github.sgroschupf zkclient ${zkclient.version} + + + zookeeper + org.apache.zookeeper + + javax.servlet @@ -252,6 +359,12 @@ com.github.subchen jetbrick-template-springmvc ${jetbrick-template.version} + + + spring-webmvc + org.springframework + + diff --git a/src/main/java/com/handu/open/dubbo/monitor/DubboMonitorService.java b/src/main/java/com/handu/open/dubbo/monitor/DubboMonitorService.java index 4d29dfb..c77bded 100644 --- a/src/main/java/com/handu/open/dubbo/monitor/DubboMonitorService.java +++ b/src/main/java/com/handu/open/dubbo/monitor/DubboMonitorService.java @@ -27,6 +27,8 @@ import com.handu.open.dubbo.monitor.support.Dao; import com.handu.open.dubbo.monitor.support.UuidUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationListener; import org.springframework.util.StringUtils; import javax.annotation.PostConstruct; @@ -42,8 +44,8 @@ * * @author Jinkai.Ma */ -@Service(delay = -1) -public class DubboMonitorService implements MonitorService { +@Service(validation = "dubboMonitorService", delay = 3000) +public class DubboMonitorService implements MonitorService, ApplicationListener { private static final Logger logger = LoggerFactory.getLogger(DubboMonitorService.class); @@ -208,4 +210,8 @@ public Map countDubboInvokeTopTen(DubboInvoke dubboInvoke) { result.put("failure", dao.getList(CLASSNAME, "countDubboInvokeFailureTopTen", dubboInvoke)); return result; } + + public void onApplicationEvent(ApplicationEvent event) { + + } } \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f33d35f..5ffa3ca 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. dubbo.application.name=dubbo-monitor -dubbo.application.owner= -dubbo.registry.address=zookeeper://192.168.1.114:2181?backup=192.168.1.114:2182,192.168.1.114:2183 +dubbo.application.owner=volshell +dubbo.registry.address=zookeeper://localhost:2181 dubbo.protocol.port=6060 # Database Settings -db.url=jdbc:mysql://default:3306/dubbokeeper?prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8 +db.url=jdbc:mysql://localhost:3306/volshell?prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8 db.username=root -db.password=raycool +db.password=volshell db.maxActive=500 # System Manager