6 changed files with 63 additions and 9 deletions
@ -0,0 +1,23 @@ |
|||||||
|
package net.sopod.soim.entry; |
||||||
|
|
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.boot.SpringApplication; |
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||||
|
|
||||||
|
/** |
||||||
|
* EntryMain |
||||||
|
* |
||||||
|
* @author tmy |
||||||
|
* @date 2022-03-26 00:06 |
||||||
|
*/ |
||||||
|
@SpringBootApplication |
||||||
|
public class EntryApplication { |
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EntryApplication.class); |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
SpringApplication.run(EntryApplication.class, args); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -1,25 +1,28 @@ |
|||||||
package net.sopod.soim.entry; |
package net.sopod.soim.entry.server; |
||||||
|
|
||||||
import net.sopod.soim.entry.server.EntryServer; |
|
||||||
import org.slf4j.Logger; |
import org.slf4j.Logger; |
||||||
import org.slf4j.LoggerFactory; |
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.boot.ApplicationArguments; |
||||||
|
import org.springframework.boot.ApplicationRunner; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
/** |
/** |
||||||
* EntryMain |
* ServerRunner |
||||||
* |
* |
||||||
* @author tmy |
* @author tmy |
||||||
* @date 2022-03-26 00:06 |
* @date 2022-03-29 00:22 |
||||||
*/ |
*/ |
||||||
public class EntryMain { |
@Component |
||||||
|
public class EntryServerStarter implements ApplicationRunner { |
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(EntryMain.class); |
private static final Logger logger = LoggerFactory.getLogger(EntryServerStarter.class); |
||||||
|
|
||||||
public static void main(String[] args) { |
@Override |
||||||
|
public void run(ApplicationArguments args) { |
||||||
EntryServer entryServer = new EntryServer("entry server", 8088); |
EntryServer entryServer = new EntryServer("entry server", 8088); |
||||||
entryServer.startServer(err -> { |
entryServer.startServer(err -> { |
||||||
logger.error("EntryServer 启动失败:", err); |
logger.error("EntryServer 启动失败:", err); |
||||||
}); |
}); |
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread(entryServer::shutdown)); |
Runtime.getRuntime().addShutdownHook(new Thread(entryServer::shutdown)); |
||||||
} |
} |
||||||
|
|
||||||
@ -0,0 +1,4 @@ |
|||||||
|
dubbo: |
||||||
|
enabled: false |
||||||
|
application: |
||||||
|
name: im-entry |
||||||
Loading…
Reference in new issue