Spring Integration tcp/ip connection delay












2















We are using Spring integration 4.1.3.



Sometimes it takes more than 5 seconds to request a connection from a particular server.



What is happening between step1 and step2?



Why is it delayed?



Client Log



step1 :▶ DEBUG 11.28 18:14:33.237  [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory[obtainNewConnection:98] - Opening new socket connection to 10.0.12.111:36401
step2 :▶ DEBUG 11.28 18:14:38.306 [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetConnection[<init>:138] - New connection 10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


Client Config



<int:gateway id="gw-vacct-tcp-sender"
service-interface="com.mainpay.pay.service.TcpSendVacctGateway"
default-request-channel="vacct-input"
default-reply-channel="vacct-reply"
/>

<int-tcp:tcp-connection-factory id="vacct-client"
type="client"
host="#{springSetting['pay.pg.ngin.vip']}"
port="#{springSetting['pay.pg.ngin.vacct.port']}"
serializer="TCPJsonSerializer8"
deserializer="TCPJsonDeserializer8"
single-use="true"
so-timeout="20000"

/>

<int:channel id="vacct-input" />

<int-tcp:tcp-outbound-gateway id="vacct-outGateway"
request-channel="vacct-input"
reply-channel="vacct-reply"
connection-factory="vacct-client"
reply-timeout="20000"
/>

<int:channel id="vacct-reply" datatype="java.lang.String" />









share|improve this question

























  • It's a test server and it's free.

    – Mr Cho
    Nov 28 '18 at 9:38
















2















We are using Spring integration 4.1.3.



Sometimes it takes more than 5 seconds to request a connection from a particular server.



What is happening between step1 and step2?



Why is it delayed?



Client Log



step1 :▶ DEBUG 11.28 18:14:33.237  [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory[obtainNewConnection:98] - Opening new socket connection to 10.0.12.111:36401
step2 :▶ DEBUG 11.28 18:14:38.306 [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetConnection[<init>:138] - New connection 10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


Client Config



<int:gateway id="gw-vacct-tcp-sender"
service-interface="com.mainpay.pay.service.TcpSendVacctGateway"
default-request-channel="vacct-input"
default-reply-channel="vacct-reply"
/>

<int-tcp:tcp-connection-factory id="vacct-client"
type="client"
host="#{springSetting['pay.pg.ngin.vip']}"
port="#{springSetting['pay.pg.ngin.vacct.port']}"
serializer="TCPJsonSerializer8"
deserializer="TCPJsonDeserializer8"
single-use="true"
so-timeout="20000"

/>

<int:channel id="vacct-input" />

<int-tcp:tcp-outbound-gateway id="vacct-outGateway"
request-channel="vacct-input"
reply-channel="vacct-reply"
connection-factory="vacct-client"
reply-timeout="20000"
/>

<int:channel id="vacct-reply" datatype="java.lang.String" />









share|improve this question

























  • It's a test server and it's free.

    – Mr Cho
    Nov 28 '18 at 9:38














2












2








2








We are using Spring integration 4.1.3.



Sometimes it takes more than 5 seconds to request a connection from a particular server.



What is happening between step1 and step2?



Why is it delayed?



Client Log



step1 :▶ DEBUG 11.28 18:14:33.237  [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory[obtainNewConnection:98] - Opening new socket connection to 10.0.12.111:36401
step2 :▶ DEBUG 11.28 18:14:38.306 [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetConnection[<init>:138] - New connection 10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


Client Config



<int:gateway id="gw-vacct-tcp-sender"
service-interface="com.mainpay.pay.service.TcpSendVacctGateway"
default-request-channel="vacct-input"
default-reply-channel="vacct-reply"
/>

<int-tcp:tcp-connection-factory id="vacct-client"
type="client"
host="#{springSetting['pay.pg.ngin.vip']}"
port="#{springSetting['pay.pg.ngin.vacct.port']}"
serializer="TCPJsonSerializer8"
deserializer="TCPJsonDeserializer8"
single-use="true"
so-timeout="20000"

/>

<int:channel id="vacct-input" />

<int-tcp:tcp-outbound-gateway id="vacct-outGateway"
request-channel="vacct-input"
reply-channel="vacct-reply"
connection-factory="vacct-client"
reply-timeout="20000"
/>

<int:channel id="vacct-reply" datatype="java.lang.String" />









share|improve this question
















We are using Spring integration 4.1.3.



Sometimes it takes more than 5 seconds to request a connection from a particular server.



What is happening between step1 and step2?



Why is it delayed?



Client Log



step1 :▶ DEBUG 11.28 18:14:33.237  [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory[obtainNewConnection:98] - Opening new socket connection to 10.0.12.111:36401
step2 :▶ DEBUG 11.28 18:14:38.306 [ajp-bio-8109-exec-3] org.springframework.integration.ip.tcp.connection.TcpNetConnection[<init>:138] - New connection 10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


Client Config



<int:gateway id="gw-vacct-tcp-sender"
service-interface="com.mainpay.pay.service.TcpSendVacctGateway"
default-request-channel="vacct-input"
default-reply-channel="vacct-reply"
/>

<int-tcp:tcp-connection-factory id="vacct-client"
type="client"
host="#{springSetting['pay.pg.ngin.vip']}"
port="#{springSetting['pay.pg.ngin.vacct.port']}"
serializer="TCPJsonSerializer8"
deserializer="TCPJsonDeserializer8"
single-use="true"
so-timeout="20000"

/>

<int:channel id="vacct-input" />

<int-tcp:tcp-outbound-gateway id="vacct-outGateway"
request-channel="vacct-input"
reply-channel="vacct-reply"
connection-factory="vacct-client"
reply-timeout="20000"
/>

<int:channel id="vacct-reply" datatype="java.lang.String" />






java spring spring-integration tcp-ip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 28 '18 at 9:45







Mr Cho

















asked Nov 28 '18 at 9:36









Mr ChoMr Cho

305




305













  • It's a test server and it's free.

    – Mr Cho
    Nov 28 '18 at 9:38



















  • It's a test server and it's free.

    – Mr Cho
    Nov 28 '18 at 9:38

















It's a test server and it's free.

– Mr Cho
Nov 28 '18 at 9:38





It's a test server and it's free.

– Mr Cho
Nov 28 '18 at 9:38












1 Answer
1






active

oldest

votes


















1














Try setting lookup-host to false; perhaps there is a problem in the network with reverse host lookups. It appears that the lookup failed since it is an ip address in the connection id.



10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


See the documentation.




By default, reverse DNS lookups are done on inbound packets to convert IP addresses to hostnames for use in message headers. In environments where DNS is not configured, this can cause connection delays. You can override this default behavior by setting the lookup-host attribute to false.







share|improve this answer
























  • The connection delay issue no longer occurs. Thank you very much.

    – Mr Cho
    Nov 29 '18 at 1:27











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53516296%2fspring-integration-tcp-ip-connection-delay%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Try setting lookup-host to false; perhaps there is a problem in the network with reverse host lookups. It appears that the lookup failed since it is an ip address in the connection id.



10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


See the documentation.




By default, reverse DNS lookups are done on inbound packets to convert IP addresses to hostnames for use in message headers. In environments where DNS is not configured, this can cause connection delays. You can override this default behavior by setting the lookup-host attribute to false.







share|improve this answer
























  • The connection delay issue no longer occurs. Thank you very much.

    – Mr Cho
    Nov 29 '18 at 1:27
















1














Try setting lookup-host to false; perhaps there is a problem in the network with reverse host lookups. It appears that the lookup failed since it is an ip address in the connection id.



10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


See the documentation.




By default, reverse DNS lookups are done on inbound packets to convert IP addresses to hostnames for use in message headers. In environments where DNS is not configured, this can cause connection delays. You can override this default behavior by setting the lookup-host attribute to false.







share|improve this answer
























  • The connection delay issue no longer occurs. Thank you very much.

    – Mr Cho
    Nov 29 '18 at 1:27














1












1








1







Try setting lookup-host to false; perhaps there is a problem in the network with reverse host lookups. It appears that the lookup failed since it is an ip address in the connection id.



10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


See the documentation.




By default, reverse DNS lookups are done on inbound packets to convert IP addresses to hostnames for use in message headers. In environments where DNS is not configured, this can cause connection delays. You can override this default behavior by setting the lookup-host attribute to false.







share|improve this answer













Try setting lookup-host to false; perhaps there is a problem in the network with reverse host lookups. It appears that the lookup failed since it is an ip address in the connection id.



10.0.12.111:36401:2701:561f3524-c421-45ba-9ea5-76a7ddf96430


See the documentation.




By default, reverse DNS lookups are done on inbound packets to convert IP addresses to hostnames for use in message headers. In environments where DNS is not configured, this can cause connection delays. You can override this default behavior by setting the lookup-host attribute to false.








share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 28 '18 at 14:03









Gary RussellGary Russell

83.8k74975




83.8k74975













  • The connection delay issue no longer occurs. Thank you very much.

    – Mr Cho
    Nov 29 '18 at 1:27



















  • The connection delay issue no longer occurs. Thank you very much.

    – Mr Cho
    Nov 29 '18 at 1:27

















The connection delay issue no longer occurs. Thank you very much.

– Mr Cho
Nov 29 '18 at 1:27





The connection delay issue no longer occurs. Thank you very much.

– Mr Cho
Nov 29 '18 at 1:27




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53516296%2fspring-integration-tcp-ip-connection-delay%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks