Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現在、Apache Spark Streaming を使用しています。ストリーミングを停止してデータ ソースへの接続を再開できるように、外部データ ソースとの接続が失われたかどうかを検出する方法を知りたいです。
助けてくれてありがとう
受信者にリスナーを追加し、受信者が停止したときにストリーミング コンテキストを停止します。
例:
streamContext.addStreamingListener(new StreamingListener() { @Override public void onReceiverStopped(StreamingListenerReceiverStopped arg0) { streamContext.stop(true, true); } }