From cd64b5ee92e10389bb2352d2775d8e3d52d79370 Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Wed, 4 Dec 2024 17:44:51 +0800 Subject: [PATCH] fix (#449) --- src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md | 4 +++- src/UserGuide/latest/API/Programming-Java-Native-API.md | 4 +++- .../UserGuide/Master/Tree/API/Programming-Java-Native-API.md | 4 +++- src/zh/UserGuide/latest/API/Programming-Java-Native-API.md | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) 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); } });