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 3d558c09..e585cae3 100644 --- a/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md +++ b/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md @@ -777,7 +777,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 3d558c09..e585cae3 100644 --- a/src/UserGuide/latest/API/Programming-Java-Native-API.md +++ b/src/UserGuide/latest/API/Programming-Java-Native-API.md @@ -777,7 +777,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 3cc23929..4dbc92f8 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 @@ -733,7 +733,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 3cc23929..4dbc92f8 100644 --- a/src/zh/UserGuide/latest/API/Programming-Java-Native-API.md +++ b/src/zh/UserGuide/latest/API/Programming-Java-Native-API.md @@ -733,7 +733,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); } });