{"id":131,"date":"2011-11-03T12:54:29","date_gmt":"2011-11-03T11:54:29","guid":{"rendered":"http:\/\/www.christiaannieuwlaat.nl\/?p=131"},"modified":"2011-11-03T12:54:29","modified_gmt":"2011-11-03T11:54:29","slug":"biztalk-wcf-sendreceive-port-connection-problem","status":"publish","type":"post","link":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/","title":{"rendered":"BizTalk WCF Send\/Receive port connection problem"},"content":{"rendered":"<p>The last few days I&#8217;ve been hunting down a problem which is quite common under users of WCF. It seems WCF will only honor a specified amount of concurrent connections ( at default this will be 10 concurrent connections ) before &#8216;freezing&#8217;.<\/p>\n<p>The most common causes of this &#8216;freeze&#8217; are :<\/p>\n<ul>\n<li>forgetting to\u00a0Close() the client proxy (and connection) when you&#8217;re done processing<\/li>\n<li>forgetting to\u00a0call Abort() on the client proxy \u00a0whenever an exception has been thrown<\/li>\n<li>using the &#8216;using (&#8230;) { }&#8217; construction on the wcf client proxy.<\/li>\n<\/ul>\n<p>When you forget one of these the connection will not be closed. ( or it will be closed later on by the framework itself, but that&#8217;s most likely not the way you want it. )<\/p>\n<p>Sounds pretty easy right? Just enclose the proxy calls in a try &#8211; catch and make sure the connection gets closed properly.<\/p>\n<p>It&#8217;s not that easy when you are using BizTalk Server as an endpoint. There are a few caveats when you&#8217;re having a complex ( multi application ) BizTalk solution which is using WCF adapters for its logical ports.<\/p>\n<ol>\n<li>Make sure when you use request\/response ports to <strong>always <\/strong>return a response message, even when things fail in your orchestration(s). When you terminate the orchestration without returning a response, the connection will <strong>not<\/strong>\u00a0be closed.<\/li>\n<li>When you have a multi application solution it gets even more important to do it right.Lets say you have an already existing (almost legacy) application which has a logical request\/response port ( which is bound to a WCF receive location ) and this port has a fault operation, which works fine with the receive location itself.\u00a0You have created an application which internally uses you&#8217;re existing application using the same logical port, and it has it&#8217;s own entryport, which is also a send\/receive port using WCF as its receive location.\n<p>You now need to be very sure that the new application uses \u00a0the send and receive actions and handles possible fault messages from the legacy application. Say the new application will send the old application a message and will wait indefinitely for an answer on the response operation, but the legacy application fails and sends a message on the fault operation, which isn&#8217;t picked up by the new application. This new application will never close the opened connection on the WCF receive-location.<\/li>\n<\/ol>\n<p>If this happens about 10 times, it&#8217;s the end of the story for the new application receive location and it won&#8217;t respond anymore ( it hangs so-to-speak&#8230; ) The only thing you can do then is to forcibly stop and start the application pool ( when the receive location runs in the isolated host ) or the biztalk server process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The last few days I&#8217;ve been hunting down a problem which is quite common under users of WCF. It seems WCF will only honor a specified amount of concurrent connections ( at default this will be 10 concurrent connections ) before &#8216;freezing&#8217;. The most common causes of this &#8216;freeze&#8217; are : forgetting to\u00a0Close() the client [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5,7,21,1],"tags":[19,23,24],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>BizTalk WCF Connection is unresponsive (hangs)<\/title>\n<meta name=\"description\" content=\"When using BizTalk with WCF receive locations, make sure you always return a response message or else it might hang your app-pool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"BizTalk WCF Connection is unresponsive (hangs)\" \/>\n<meta property=\"og:description\" content=\"When using BizTalk with WCF receive locations, make sure you always return a response message or else it might hang your app-pool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/\" \/>\n<meta property=\"og:site_name\" content=\"Christiaan Nieuwlaat .nl\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/christiaan.nieuwlaat\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-03T11:54:29+00:00\" \/>\n<meta name=\"author\" content=\"chris\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@krizzje\" \/>\n<meta name=\"twitter:site\" content=\"@krizzje\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"chris\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/\",\"url\":\"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/\",\"name\":\"BizTalk WCF Connection is unresponsive (hangs)\",\"isPartOf\":{\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/#website\"},\"datePublished\":\"2011-11-03T11:54:29+00:00\",\"dateModified\":\"2011-11-03T11:54:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/#\/schema\/person\/db0e2d25ff2c1c9a5c2f86c22081bbef\"},\"description\":\"When using BizTalk with WCF receive locations, make sure you always return a response message or else it might hang your app-pool.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.christiaannieuwlaat.nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BizTalk WCF Send\/Receive port connection problem\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/#website\",\"url\":\"https:\/\/www.christiaannieuwlaat.nl\/\",\"name\":\"Christiaan Nieuwlaat .nl\",\"description\":\"IT Whizzkid behind the wheels of steel\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.christiaannieuwlaat.nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/#\/schema\/person\/db0e2d25ff2c1c9a5c2f86c22081bbef\",\"name\":\"chris\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.christiaannieuwlaat.nl\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7e1e034197de6790df1ed0095c77a136?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7e1e034197de6790df1ed0095c77a136?s=96&d=mm&r=g\",\"caption\":\"chris\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BizTalk WCF Connection is unresponsive (hangs)","description":"When using BizTalk with WCF receive locations, make sure you always return a response message or else it might hang your app-pool.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/","og_locale":"en_US","og_type":"article","og_title":"BizTalk WCF Connection is unresponsive (hangs)","og_description":"When using BizTalk with WCF receive locations, make sure you always return a response message or else it might hang your app-pool.","og_url":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/","og_site_name":"Christiaan Nieuwlaat .nl","article_publisher":"https:\/\/www.facebook.com\/christiaan.nieuwlaat","article_published_time":"2011-11-03T11:54:29+00:00","author":"chris","twitter_card":"summary_large_image","twitter_creator":"@krizzje","twitter_site":"@krizzje","twitter_misc":{"Written by":"chris","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/","url":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/","name":"BizTalk WCF Connection is unresponsive (hangs)","isPartOf":{"@id":"https:\/\/www.christiaannieuwlaat.nl\/#website"},"datePublished":"2011-11-03T11:54:29+00:00","dateModified":"2011-11-03T11:54:29+00:00","author":{"@id":"https:\/\/www.christiaannieuwlaat.nl\/#\/schema\/person\/db0e2d25ff2c1c9a5c2f86c22081bbef"},"description":"When using BizTalk with WCF receive locations, make sure you always return a response message or else it might hang your app-pool.","breadcrumb":{"@id":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/2011\/11\/03\/biztalk-wcf-sendreceive-port-connection-problem\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.christiaannieuwlaat.nl\/"},{"@type":"ListItem","position":2,"name":"BizTalk WCF Send\/Receive port connection problem"}]},{"@type":"WebSite","@id":"https:\/\/www.christiaannieuwlaat.nl\/#website","url":"https:\/\/www.christiaannieuwlaat.nl\/","name":"Christiaan Nieuwlaat .nl","description":"IT Whizzkid behind the wheels of steel","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.christiaannieuwlaat.nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.christiaannieuwlaat.nl\/#\/schema\/person\/db0e2d25ff2c1c9a5c2f86c22081bbef","name":"chris","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.christiaannieuwlaat.nl\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7e1e034197de6790df1ed0095c77a136?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7e1e034197de6790df1ed0095c77a136?s=96&d=mm&r=g","caption":"chris"}}]}},"_links":{"self":[{"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/posts\/131"}],"collection":[{"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":0,"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.christiaannieuwlaat.nl\/index.php\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}