先日、VMのメモリが枯渇してどうにもならので、ActiveMQサーバプロセスを別VM上に切り出してクライアントとの間の通信はREST経由としたんだが、どうもたまに電文が欠落しているような気がして、まぁTwitterへの投稿なので別に良いけど、一応ログを見た。
 やっぱり欠落していた。クライアント側でPOSTが3発目毎に固まっているように見える。HTTPSサーバ側では2発しか受けていない。おそらく、何かFlashとかCommitとか何か終末的処理が抜けているのだろうと思って調べたら
HttpClient - HttpClient Tutorial

method.releaseConnection();

が行われていなかった。

This is a crucial step to keep things flowing. We must tell HttpClient that we are done with the connection and that it can now be reused. Without doing this HttpClient will wait indefinitely for a connection to free up so that it can be reused.

http://hc.apache.org/httpclient-legacy/tutorial.html

とのこと。
こんなものがあったとは。迂闊。毎回1発しか試してなかったから見つからなかったんだな。しかし1発目成功、2発目から固まるなら分かるが、なんで3発目から固まっていたのだろう…。

RESTful Webサービス
RESTful Webサービス
posted with amazlet at 17.10.20
Leonard Richardson Sam Ruby
オライリー・ジャパン
売り上げランキング: 46,783