diff --git a/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md b/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md index 24259056..387a9e07 100644 --- a/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md +++ b/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md @@ -773,7 +773,9 @@ for (int i = 0; i < 8; ++i) { .buildPushConsumer()) { consumer2.open(); consumer2.subscribe(TOPIC_2); - } catch (final IOException e) { + // block the consumer main thread + Thread.sleep(Long.MAX_VALUE); + } catch (final IOException | InterruptedException e) { throw new RuntimeException(e); } }); diff --git a/src/UserGuide/latest/API/Programming-Java-Native-API.md b/src/UserGuide/latest/API/Programming-Java-Native-API.md index 24259056..387a9e07 100644 --- a/src/UserGuide/latest/API/Programming-Java-Native-API.md +++ b/src/UserGuide/latest/API/Programming-Java-Native-API.md @@ -773,7 +773,9 @@ for (int i = 0; i < 8; ++i) { .buildPushConsumer()) { consumer2.open(); consumer2.subscribe(TOPIC_2); - } catch (final IOException e) { + // block the consumer main thread + Thread.sleep(Long.MAX_VALUE); + } catch (final IOException | InterruptedException e) { throw new RuntimeException(e); } }); diff --git a/src/zh/UserGuide/Master/Tree/API/Programming-Java-Native-API.md b/src/zh/UserGuide/Master/Tree/API/Programming-Java-Native-API.md index 07e3dce6..7c952a91 100644 --- a/src/zh/UserGuide/Master/Tree/API/Programming-Java-Native-API.md +++ b/src/zh/UserGuide/Master/Tree/API/Programming-Java-Native-API.md @@ -726,7 +726,9 @@ for (int i = 0; i < 8; ++i) { .buildPushConsumer()) { consumer2.open(); consumer2.subscribe(TOPIC_2); - } catch (final IOException e) { + // block the consumer main thread + Thread.sleep(Long.MAX_VALUE); + } catch (final IOException | InterruptedException e) { throw new RuntimeException(e); } }); diff --git a/src/zh/UserGuide/latest/API/Programming-Java-Native-API.md b/src/zh/UserGuide/latest/API/Programming-Java-Native-API.md index d2811bbb..8c68005d 100644 --- a/src/zh/UserGuide/latest/API/Programming-Java-Native-API.md +++ b/src/zh/UserGuide/latest/API/Programming-Java-Native-API.md @@ -725,7 +725,9 @@ for (int i = 0; i < 8; ++i) { .buildPushConsumer()) { consumer2.open(); consumer2.subscribe(TOPIC_2); - } catch (final IOException e) { + // block the consumer main thread + Thread.sleep(Long.MAX_VALUE); + } catch (final IOException | InterruptedException e) { throw new RuntimeException(e); } });