Skip to content

Commit

Permalink
Update ServerListener.java
Browse files Browse the repository at this point in the history
springcloud 打成war包执行的时候,并不走EmbeddedServletContainerInitializedEvent这个事件,所以可以监听ApplicationReadyEvent事件,将ServerListener,InitService注入新的监听器中启动客户端。springcloud的端口号一般都会配置,所以可以从配置文件中获取。
  • Loading branch information
ahao888 authored Mar 16, 2018
1 parent 5f8f55a commit dc76943
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) {
public int getPort() {
return this.serverPort;
}

public void setServerPort(int serverPort) {
this.serverPort = serverPort;
}
}

0 comments on commit dc76943

Please sign in to comment.