Skip to content

Commit

Permalink
HWKALERTS-50 Rebase on master (hwkalerts-57, 17)
Browse files Browse the repository at this point in the history
- Finally get external alerter to be its own (war) deployment
  - remove hawkular-alerts-metrics-ear
  - package hawkular-alerts-metrics as war instead of ear
- Move external alerter itests from alerts-rest-tests to alerts-metrics
  - change exe profile from -Pexternal to -Pitest
- remove unnecessary beans.xml from alerts-rest
- add beans.xml to alerter war, note that 'all' discovery mode is required
- add jboss-all.xml to alerter war to ensure deployment after co-located metrics
  • Loading branch information
jshaughn committed Jul 2, 2015
1 parent 18c30ef commit 5bc3d7f
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 60 deletions.
80 changes: 76 additions & 4 deletions hawkular-alerts-metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -26,10 +27,10 @@
<version>0.3.0.Final-SNAPSHOT</version>
</parent>

<artifactId>hawkular-alerts-metrics</artifactId>
<packaging>jar</packaging>
<artifactId>hawkular-alerter-metrics</artifactId>
<packaging>war</packaging>

<name>Hawkular Alerts External Metrics Evaluator</name>
<name>Hawkular External Alerter: Metrics</name>

<dependencies>

Expand Down Expand Up @@ -84,6 +85,77 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/external/*ITest*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<!-- ITests require a running server with metrics, alerts and the external alerter running -->
<profile>
<id>itest</id>
<properties>
<!-- IMPORTANT: The port must be the port offset + 8080. -->
<hawkular.host>127.0.0.1</hawkular.host>
<hawkular.port>8080</hawkular.port>
<hawkular.path>/hawkular/</hawkular.path>
<hawkular.base-uri>http://${hawkular.host}:${hawkular.port}${hawkular.path}</hawkular.base-uri>
<hawkular.base-uri-alerts>${hawkular.base-uri}/alerts/</hawkular.base-uri-alerts>
<hawkular.base-uri-metrics>${hawkular.base-uri}/metrics/</hawkular.base-uri-metrics>
<!-- IMPORTANT: The management port must be the port offset + 9990. -->
<wildfly.management.port>11887</wildfly.management.port>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/metrics/*Test*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*ITest*</include>
</includes>
<systemPropertyVariables>
<hawkular.host>${hawkular.host}</hawkular.host>
<hawkular.port>${hawkular.port}</hawkular.port>
<hawkular.base-uri>${hawkular.base-uri}</hawkular.base-uri>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public class Manager {
@Inject
private MetricsService metrics;

@EJB
@EJB(mappedName = "java:global/hawkular-alerts-rest/CassDefinitionsServiceImpl")
private DefinitionsService definitions;

@EJB
@EJB(mappedName = "java:global/hawkular-alerts-rest/CassAlertsServiceImpl")
private AlertsService alerts;

@PostConstruct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 Red Hat, Inc. and/or its affiliates
Expand All @@ -19,6 +19,7 @@
-->
<jboss umlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<!-- Ensure metrics is deployed, started and initialized before we try to establish a session -->
<dependency name="hawkular-metrics-api-jaxrs.war"/>
</jboss-deployment-dependencies>
</jboss>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<!--
Copyright 2015 Red Hat, Inc. and/or its affiliates
Expand All @@ -17,8 +17,12 @@
limitations under the License.
-->
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">
</beans>
<jboss-deployment-structure>

<deployment>
<dependencies>
<module name="deployment.hawkular-alerts-rest.war" />
</dependencies>
</deployment>

</jboss-deployment-structure>
22 changes: 22 additions & 0 deletions hawkular-alerts-metrics/src/main/webapp/WEB-INF/jboss-web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<!--
Copyright 2015 Red Hat, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<jboss-web>
<context-root>/hawkular/__alerter_metrics</context-root>
</jboss-web>
27 changes: 27 additions & 0 deletions hawkular-alerts-metrics/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Copyright 2015 Red Hat, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">

<display-name>Hawkular Alerter: Metrics</display-name>
<description>A Hawkular Alerts External Alerter for alerting on aggregate Hawkular Metrics data.</description>

</web-app>
26 changes: 26 additions & 0 deletions hawkular-alerts-metrics/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<%--
Copyright 2015 Red Hat, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--%>
<html>
<head>
<title>Hawkular Alerts Engine</title>
</head>
<body>
<h3>Hawkular Alerts Engine</h3>
</body>
</html>
46 changes: 0 additions & 46 deletions hawkular-alerts-rest-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,49 +131,6 @@
<includes>
<include>**/*ITest*</include>
</includes>
<excludes>
<exclude>**/external/*ITest*</exclude>
</excludes>
<systemPropertyVariables>
<hawkular.host>${hawkular.host}</hawkular.host>
<hawkular.port>${hawkular.port}</hawkular.port>
<hawkular.base-uri>${hawkular.base-uri}</hawkular.base-uri>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>external</id>
<properties>
<!-- IMPORTANT: The port must be the port offset + 8080. -->
<hawkular.host>127.0.0.1</hawkular.host>
<hawkular.port>8080</hawkular.port>
<hawkular.path>/hawkular/</hawkular.path>
<hawkular.base-uri>http://${hawkular.host}:${hawkular.port}${hawkular.path}</hawkular.base-uri>
<hawkular.base-uri-alerts>${hawkular.base-uri}/alerts/</hawkular.base-uri-alerts>
<hawkular.base-uri-metrics>${hawkular.base-uri}/metrics/</hawkular.base-uri-metrics>
<!-- IMPORTANT: The management port must be the port offset + 9990. -->
<wildfly.management.port>11887</wildfly.management.port>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/external/*ITest*</include>
</includes>
<systemPropertyVariables>
<hawkular.host>${hawkular.host}</hawkular.host>
<hawkular.port>${hawkular.port}</hawkular.port>
Expand Down Expand Up @@ -331,9 +288,6 @@
<includes>
<include>**/*ITest*</include>
</includes>
<excludes>
<exclude>**/external/*ITest*</exclude>
</excludes>
</configuration>
</execution>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
<module>hawkular-alerts-api</module>
<module>hawkular-alerts-engine</module>
<module>hawkular-alerts-bus</module>
<module>hawkular-alerts-metrics</module>
<module>hawkular-alerts-rest</module>
<module>hawkular-actions-api</module>
<module>hawkular-actions-plugins</module>
<module>hawkular-alerts-rest-tests</module>
<module>hawkular-alerts-metrics</module>
</modules>

<scm>
Expand Down

0 comments on commit 5bc3d7f

Please sign in to comment.