Skip to content

Commit

Permalink
Zuul-Reverse-Proxy for registered applications and removal of CORS-stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Stelzer committed Mar 4, 2015
1 parent 4302e92 commit e52f6c7
Show file tree
Hide file tree
Showing 22 changed files with 427 additions and 372 deletions.
27 changes: 27 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<spring-boot.version>1.2.2.RELEASE</spring-boot.version>
<hazelcast.version>3.3.3</hazelcast.version>
<commons-lang3.version>3.3.2</commons-lang3.version>
<spring-cloud.version>1.0.0.RELEASE</spring-cloud.version>

<build-plugin.jacoco.version>0.7.3.201502191951</build-plugin.jacoco.version>
<build-plugin.coveralls.version>3.0.1</build-plugin.coveralls.version>
Expand Down Expand Up @@ -220,6 +221,23 @@
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
<version>${spring-cloud.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-core</artifactId>
<version>${spring-cloud.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
<version>${spring-cloud.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand All @@ -244,4 +262,13 @@
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>spring-release</id>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>http://repo.spring.io/release</url>
</repository>
</repositories>
</project>
14 changes: 7 additions & 7 deletions spring-boot-admin-server-ui/app/js/service/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,31 @@ module.exports = function ($resource, $http, $rootScope) {
};

Application.prototype.getHealth = function () {
return $http.get(this.url + '/health').error(new AuthInterceptor(this));
return $http.get('api/applications/' + this.id + '/health').error(new AuthInterceptor(this));
};

Application.prototype.getInfo = function () {
return $http.get(this.url + '/info').error(new AuthInterceptor(this));
return $http.get('api/applications/' + this.id + '/info').error(new AuthInterceptor(this));
};

Application.prototype.getMetrics = function () {
return $http.get(this.url + '/metrics').error(new AuthInterceptor(this));
return $http.get('api/applications/' + this.id + '/metrics').error(new AuthInterceptor(this));
};

Application.prototype.getEnv = function () {
return $http.get(this.url + '/env').error(new AuthInterceptor(this));
return $http.get('api/applications/' + this.id + '/env').error(new AuthInterceptor(this));
};

Application.prototype.getThreadDump = function () {
return $http.get(this.url + '/dump').error(new AuthInterceptor(this));
return $http.get('api/applications/' + this.id + '/dump').error(new AuthInterceptor(this));
};

Application.prototype.getTraces = function () {
return $http.get(this.url + '/trace').error(new AuthInterceptor(this));
return $http.get('api/applications/' + this.id + '/trace').error(new AuthInterceptor(this));
};

Application.prototype.hasLogfile = function () {
return $http.head(this.url + '/logfile').error(new AuthInterceptor(this));
return $http.head('api/applications/' + this.id + '/logfile').error(new AuthInterceptor(this));
};

return Application;
Expand Down
8 changes: 4 additions & 4 deletions spring-boot-admin-server-ui/app/js/service/applicationJmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

module.exports = function ($rootScope, Abbreviator, jolokia) {
this.list = function (app) {
return jolokia.list(app.url + '/jolokia/')
return jolokia.list('/api/applications/' + app.id + '/jolokia/')
.then(function (response) {
var domains = [];
for (var rDomainName in response.value) {
Expand Down Expand Up @@ -81,14 +81,14 @@ module.exports = function ($rootScope, Abbreviator, jolokia) {
};

this.readAllAttr = function (app, bean) {
return jolokia.read(app.url + '/jolokia/', bean.id);
return jolokia.read('/api/applications/' + app.id + '/jolokia/', bean.id);
};

this.writeAttr = function (app, bean, attr, val) {
return jolokia.writeAttr(app.url + '/jolokia/', bean.id, attr, val);
return jolokia.writeAttr('/api/applications/' + app.id + '/jolokia/', bean.id, attr, val);
};

this.invoke = function (app, bean, opname, args) {
return jolokia.exec(app.url + '/jolokia/', bean.id, opname, args);
return jolokia.exec('/api/applications/' + app.id + '/jolokia/', bean.id, opname, args);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ module.exports = function ($http, jolokia) {
arguments: [loggers[j].name]
});
}
return jolokia.bulkRequest(app.url + '/jolokia/', requests);
return jolokia.bulkRequest('/api/applications/' + app.id + '/jolokia/', requests);
};

this.setLoglevel = function (app, logger, level) {
return jolokia.exec(app.url + '/jolokia/', LOGBACK_MBEAN, 'setLoggerLevel', [logger,
return jolokia.exec('/api/applications/' + app.id + '/jolokia/', LOGBACK_MBEAN, 'setLoggerLevel', [logger,
level
]);
};

this.getAllLoggers = function (app) {
return jolokia.readAttr(app.url + '/jolokia/', LOGBACK_MBEAN, 'LoggerList');
return jolokia.readAttr('/api/applications/' + app.id + '/jolokia/', LOGBACK_MBEAN, 'LoggerList');
};
};
2 changes: 1 addition & 1 deletion spring-boot-admin-server-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spring-boot-admin-server-ui",
"version": "1.1.1",
"version": "1.1.3",
"scripts": {
"postinstall": "./node_modules/protractor/bin/webdriver-manager update",
"pretest": "./node_modules/protractor/bin/webdriver-manager start &",
Expand Down
38 changes: 37 additions & 1 deletion spring-boot-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,42 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<!-- Use Zuul WITHOUT Hystrix/Ribbon/Config Client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-ribbon</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.6</version>
</dependency>


<!-- Hazelcast-Support -->
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
Expand All @@ -34,7 +70,7 @@
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-spring</artifactId>
<optional>true</optional>
</dependency>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
Expand Down
Loading

0 comments on commit e52f6c7

Please sign in to comment.