使用客户端调用TCP连接器时遇到问题。 baisc超时是10秒,但我需要更新该值。
我试图操纵任何连接值,没有运气;这是我的流程:
<mule ...>
<context:property-placeholder location="${env}.properties"/>
<tcp:connector name="tcpConnector" validateConnections="true"
receiveBufferSize="0" clientSoTimeout="0" receiveBacklog="0"
sendBufferSize="0" serverSoTimeout="0" socketSoLinger="600000"
socketMaxWait="0" connectionTimeout="0" keepAlive="true" keepSendSocketOpen="true"
doc:name="TCP connector">
<tcp:direct-protocol payloadOnly="true" />
<!-- <tcp:direct-protocol payloadOnly="true"/>
<tcp:streaming-protocol/> -->
</tcp:connector>
<!--
<configuration defaultResponseTimeout="60000" />
-->
<flow name="receiveresbFlow" doc:name="socketreceiveresbFlow" >
<tcp:inbound-endpoint exchange-pattern="request-response" responseTimeout="60000"
host="${tcp.endpoint.host}" port="${tcp.endpoint.port}" doc:name="TCP" />
<byte-array-to-string-transformer doc:name="Byte Array to String" />
<set-property propertyName="MESSAGE" value="#[payload.substring(1,payload.length()-2)]" doc:name="Property"/>
<custom-transformer class="com.message.manager.MessageCreator" doc:name="toEventObject" ></custom-transformer>
</flow>
</mule>
我更新了AnyPoint工作室,我正在使用HapiPanel来调用tcp连接器(MLLP)打开的端口。
编辑:根据要求我添加唯一的堆栈跟踪,我可以看到,当且仅当我把
rethrowExceptionOnRead = “真”
这是我从客户端获得的(因为它是从套接字服务器获取超时的客户端...):
INFO 2015-06-24 09:43:45,374 [[testreceiver].tcpConnector.receiver.02] org.mule.transport.tcp.protocols.DirectProtocol: Socket exception occured: Software caused connection abort: recv failed
ERROR 2015-06-24 09:43:45,873 [[testreceiver].tcpConnector.receiver.02] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: Software caused connection abort: recv failed
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at org.mule.model.streaming.DelegatingInputStream.read(DelegatingInputStream.java:59)
at org.mule.transport.tcp.protocols.AbstractByteProtocol.safeRead(AbstractByteProtocol.java:133)
at org.mule.transport.tcp.protocols.AbstractByteProtocol.copy(AbstractByteProtocol.java:204)
at org.mule.transport.tcp.protocols.DirectProtocol.read(DirectProtocol.java:67)
at org.mule.transport.tcp.protocols.DirectProtocol.read(DirectProtocol.java:50)
at org.mule.transport.tcp.TcpMessageReceiver$TcpWorker.getNextMessage(TcpMessageReceiver.java:361)
at org.mule.transport.AbstractReceiverResourceWorker.doRun(AbstractReceiverResourceWorker.java:41)
at org.mule.transport.AbstractReceiverWorker.run(AbstractReceiverWorker.java:62)
at org.mule.transport.TrackingWorkManager$TrackeableWork.run(TrackingWorkManager.java:267)
at org.mule.work.WorkerContext.run(WorkerContext.java:286)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
感谢您的合作!