我们有一个使用AWS(Amazone api)的Web应用程序,在coreConfiguration类中我们使用predestroy方法创建一个awsApi bean,coreConfiguration的代码是:
@Bean(destroyMethod = "destroy")
public IGridStorageManager awsApi() {
.....
}
Run Code Online (Sandbox Code Playgroud)
在 awsApi 类中我们有 detroy 方法,代码是:
@Override
@PreDestroy
public void destroy() {
if (clientS3 != null) {
clientS3.shutdown();
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是在 PROD 中的某个时候,当我使用 API 时,我看到了这些日志:
2020-08-03 11:27:00.090 DEBUG 25172 --- [java-sdk-http-connection-reaper] com.amazonaws.http.IdleConnectionReaper : Reaper thread:
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at com.amazonaws.http.IdleConnectionReaper.run(IdleConnectionReaper.java:188)
Run Code Online (Sandbox Code Playgroud)
我读到这个异常可能导致内存泄漏,我发现我们需要使用 shutdown() 方法,问题是我已经将@PreDestroy方法与 shutdown 方法一起使用,为什么我有这些异常?
你能帮助我吗 ?
谢谢
我想以这样的方式创建一个总线路由DB,它给出如下结果:
输入: Source = station-X,Destination = station-Y
输出:各种总线名称/号码.通过Station-X和Station-Y
到目前为止我有: 总线(bus_no),Bus_Route()
Bus(bus_name/no.)
id | bus_no
1 | 33
2 | 33A
Bus_Route(route_id,bus_no)
id | route_id | bus_no
1 | route-A | 33
2 | route-B | 33A
Run Code Online (Sandbox Code Playgroud)
如何继续存储相应路线的电台名称.我不是数据库专家,所以任何帮助都是有价值的.提前致谢.