我正在Spring Boot 1.5.6.RELEASE 中编写一个 UDP syslog 消息接收器,如果我不添加spring-boot-starter-web依赖项,它就会关闭。问题是我不需要网络依赖,因为应用程序只通过 TCP 接收、过滤和发送日志。我正在使用org.springframework.integration.syslog.inbound.UdpSyslogReceivingChannelAdapter.
接收者:
@Bean
public UdpSyslogReceivingChannelAdapter udpReceiver() {
final UdpSyslogReceivingChannelAdapter adapter = new UdpSyslogReceivingChannelAdapter();
adapter.setPort(properties.getUdp().getLocalPort());
adapter.setOutputChannelName("routingChannel");
adapter.setConverter(converter);
return adapter;
}
在调试时,我尝试使用org.springframework.integration.syslog.inbound.TcpSyslogReceivingChannelAdapter
,即使未添加 Web 依赖项,应用程序也不会关闭。应用程序在使用时关闭的原因是什么org.springframework.integration.syslog.inbound.UdpSyslogReceivingChannelAdapter
?我可以在没有spring-boot-starter-web
依赖的情况下使用 UdpSyslogReceivingChannelAdapter吗?
回首忆惘然
相关分类