java Solace不断示例化新的TcpClientChannel

3pmvbmvn  于 2023-06-28  发布在  Java
关注(0)|答案(1)|浏览(87)

我写了25个csv文件(每个都有大约1000多个条目)来安慰。当我开始重放队列中所有可用的消息并发布消息时,过了一段时间,我得到了这样的错误:

Client-17280: Connecting to host 'orig=tcp://vklnld2983:55555, scheme=tcp://, host=vklnld2983, port=55555' (host 1 of 1, smfclient 17280, attempt 1 of 1, this_host_attempt: 1 of 1) 
Client-17281: Connecting to host 'orig=tcp://vklnld2983:55555, scheme=tcp://, host=vklnld2983, port=55555' (host 1 of 1, smfclient 17281, attempt 1 of 1, this_host_attempt: 1 of 1)
Client-17282: Connecting to host 'orig=tcp://vklnld2983:55555, scheme=tcp://, host=vklnld2983, port=55555' (host 1 of 1, smfclient 17282, attempt 1 of 1, this_host_attempt: 1 of 1)
Client-17280: Connection attempt failed to host 'vklnld2983' ConnectException com.solacesystems.jcsmp.JCSMPTransportException: (Client name: HKGITDW137306/29042/87494380/kMGp65FuY3   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - Error communicating with the router. cause: java.net.ConnectException: Connection refused ((Client name: HKGITDW137306/29042/87494380/kMGp65FuY3   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - )
Client-17281: Connection attempt failed to host 'vklnld2983' ConnectException com.solacesystems.jcsmp.JCSMPTransportException: (Client name: HKGITDW137306/29042/874a4381/TExAJ1qMsJ   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - Error communicating with the router. cause: java.net.ConnectException: Connection refused ((Client name: HKGITDW137306/29042/874a4381/TExAJ1qMsJ   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - )
Client-17282: Connection attempt failed to host 'vklnld2983' ConnectException com.solacesystems.jcsmp.JCSMPTransportException: (Client name: HKGITDW137306/29042/874b4382/GViVP_ZJ_v   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - Error communicating with the router. cause: java.net.ConnectException: Connection refused ((Client name: HKGITDW137306/29042/874b4382/GViVP_ZJ_v   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - )
org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Error creating connection - transport error ((Client name: HKGITDW137306/29042/874a4381/TExAJ1qMsJ   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - Error communicating with the router.)
    at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:311) ~[spring-jms-5.3.24.jar:5.3.24]
    at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:185) ~[spring-jms-5.3.24.jar:5.3.24]
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:507) ~[spring-jms-5.3.24.jar:5.3.24]
    at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:584) ~[spring-jms-5.3.24.jar:5.3.24]
    at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:661) ~[spring-jms-5.3.24.jar:5.3.24]
    at com.clsa.aperture.service.inventory.InventoryService.lambda$onEvents$13(InventoryService.java:281) ~[classes/:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
    at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1850) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290) ~[?:?]
    at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754) ~[?:?]
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: javax.jms.JMSException: Error creating connection - transport error ((Client name: HKGITDW137306/29042/874a4381/TExAJ1qMsJ   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - Error communicating with the router.)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
    at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
    at com.solacesystems.jms.impl.JMSExceptionValue.newInstance(JMSExceptionValue.java:36) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.impl.JCSMPExceptionMapper$ArrayListMapper.get(JCSMPExceptionMapper.java:32) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.impl.JCSMPExceptionMapper.get(JCSMPExceptionMapper.java:95) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.impl.Validator.createJMSException(Validator.java:587) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnection.<init>(SolConnection.java:186) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnection.<init>(SolConnection.java:97) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnectionFactoryImpl.createConnection(SolConnectionFactoryImpl.java:114) ~[sol-jms-10.17.0.jar:?]
    at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:196) ~[spring-jms-5.3.24.jar:5.3.24]
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494) ~[spring-jms-5.3.24.jar:5.3.24]
    ... 13 more
Caused by: com.solacesystems.jcsmp.JCSMPTransportException: (Client name: HKGITDW137306/29042/874a4381/TExAJ1qMsJ   Local port: -1   Remote addr: vklnld2983  Remote port: 55555) - Error communicating with the router.
    at com.solacesystems.jcsmp.protocol.impl.TcpChannel.executePostOnce(TcpChannel.java:254) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.ChannelOpStrategyClient.performOpen(ChannelOpStrategyClient.java:101) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.performOpenSingle(TcpClientChannel.java:428) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.access$800(TcpClientChannel.java:124) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel$ClientChannelConnect.call(TcpClientChannel.java:2609) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.open(TcpClientChannel.java:404) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.impl.JCSMPBasicSession.sniffRouter(JCSMPBasicSession.java:422) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.impl.JCSMPBasicSession.connect(JCSMPBasicSession.java:1309) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnection.<init>(SolConnection.java:167) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnection.<init>(SolConnection.java:97) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnectionFactoryImpl.createConnection(SolConnectionFactoryImpl.java:114) ~[sol-jms-10.17.0.jar:?]
    at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:196) ~[spring-jms-5.3.24.jar:5.3.24]
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494) ~[spring-jms-5.3.24.jar:5.3.24]
    ... 13 more
Caused by: java.net.ConnectException: Connection refused
    at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
    at sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[?:?]
    at sun.nio.ch.SocketChannelImpl.finishTimedConnect(SocketChannelImpl.java:1148) ~[?:?]
    at sun.nio.ch.SocketChannelImpl.blockingConnect(SocketChannelImpl.java:1183) ~[?:?]
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:98) ~[?:?]
    at com.solacesystems.jcsmp.protocol.smf.SimpleSmfClient.open(SimpleSmfClient.java:905) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.smf.SimpleSmfClient.doPostNoResponse(SimpleSmfClient.java:318) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.smf.SimpleSmfClient.doPost(SimpleSmfClient.java:235) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpChannel.executePostOnce(TcpChannel.java:199) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.ChannelOpStrategyClient.performOpen(ChannelOpStrategyClient.java:101) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.performOpenSingle(TcpClientChannel.java:428) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.access$800(TcpClientChannel.java:124) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel$ClientChannelConnect.call(TcpClientChannel.java:2609) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.open(TcpClientChannel.java:404) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.impl.JCSMPBasicSession.sniffRouter(JCSMPBasicSession.java:422) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jcsmp.impl.JCSMPBasicSession.connect(JCSMPBasicSession.java:1309) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnection.<init>(SolConnection.java:167) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnection.<init>(SolConnection.java:97) ~[sol-jms-10.17.0.jar:?]
    at com.solacesystems.jms.SolConnectionFactoryImpl.createConnection(SolConnectionFactoryImpl.java:114) ~[sol-jms-10.17.0.jar:?]
    at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:196) ~[spring-jms-5.3.24.jar:5.3.24]
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494) ~[spring-jms-5.3.24.jar:5.3.24]
    ... 13 more

查看日志/堆栈跟踪,似乎我的应用程序正在进行大量的连接/断开连接,但我不确定我是否正在耗尽某种连接池,或者solace将此操作视为“垃圾邮件”并拒绝从我的本地主机连接。如何重用TcpClientChannels而不是在每次尝试连接时示例化新连接?

t98cgbkg

t98cgbkg1#

你用的是CachingConnectionFactory?你要确保你没有为每一条消息创建和拆除一个连接以及与之相关的所有东西。
使用Sping Boot 的示例:https://tutorials.solace.dev/spring/spring-boot-autoconfigure/#SpringBootSenderjava

相关问题