簡単な質問:
「Broken Pipe Error」を防ぐために、RabbitMQ の通信中に 2 つの独立したアプリケーションが同時に同じチャネルを使用しないように祈る必要がありますか? (または、スレッド化は、2 つ以上の独立したアプリケーションを持つこととは異なりますか?)
歴史:
私はいくつかのアプリケーションを作成しましたが、そのうちの 1 つ (io-server) は、他のアプリケーションの観点からはサーバーのように機能し、RabbitMQ サーバーの観点からはクライアントのように機能しています。
これで、約 10 分間、すべてが期待どおりに機能します。次に、io-server がクラッシュします。トレースバックの最後の部分は次のとおりです。
File "/usr/local/lib/python2.7/dist-packages/amqp-1.4.2-py2.7.egg/amqp/transport.py", line 163, in write_frame
frame_type, channel, size, payload, 0xce,
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 32] Broken pipe
RabbitMQ ログの関連部分は次のとおりです。
=ERROR REPORT==== 31-Mar-2014::12:29:53 ===
AMQP connection <0.22183.0> (running), channel 1 - error:
{amqp_error,unexpected_frame,
"expected content header for class 60, got non content header frame instead",
'basic.publish'}
=INFO REPORT==== 31-Mar-2014::12:30:23 ===
closing AMQP connection <0.22183.0> (127.0.0.1:43367 -> 127.0.0.1:5672)
ネットを検索できる限り、最も有望な答えは次のとおりです。
...
So yes, RabbitMQ closes the connection due to a connection-level error
with frame interleaving.
...
* Avoid publishing on *the same* channel from multiple threads
* Synchronize publishing in your own code
アプリを同期的に公開することがあります。しかし、すべてのアプリケーションが同期して実行されることを保証するにはどうすればよいでしょうか? 私は本当にしなければならないのですか?