Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@
* <p>
* NOTE: at least an external standalone server (if not an ensemble) are recommended, even for
* {@link org.springframework.xd.dirt.server.singlenode.SingleNodeApplication}
* <p>
* IMPORTANT: For production/business usage, it is recommended to use a regular ZooKeeper installation
* instead of this embedded version. To install and run regular ZooKeeper:
* <ol>
* <li>Download ZooKeeper from https://zookeeper.apache.org/releases.html</li>
* <li>Extract the downloaded archive</li>
* <li>Configure zoo.cfg in the conf directory</li>
* <li>Start ZooKeeper using: bin/zkServer.sh start (Linux/Mac) or bin/zkServer.cmd start (Windows)</li>
* <li>Stop ZooKeeper using: bin/zkServer.sh stop (Linux/Mac) or bin/zkServer.cmd stop (Windows)</li>
* </ol>
* This embedded version is primarily intended for testing and development purposes only.
*/
public class EmbeddedZooKeeper implements SmartLifecycle {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ class SpringBootConfigPropsTest {
@BeforeAll
public static void beforeAll() {
DubboBootstrap.reset();
System.clearProperty("dubbo.metrics.protocol");
}

@AfterAll
public static void afterAll() {
DubboBootstrap.reset();
System.clearProperty("dubbo.metrics.protocol");
}

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ class SpringBootMultipleConfigPropsTest {
@BeforeAll
public static void beforeAll() {
DubboBootstrap.reset();
System.clearProperty("dubbo.metrics.protocol");
}

@AfterAll
public static void afterAll() {
DubboBootstrap.reset();
System.clearProperty("dubbo.metrics.protocol");
}

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ public class SpringBootConfigMetricsTest {
@BeforeAll
public static void beforeAll() {
DubboBootstrap.reset();
System.clearProperty("dubbo.metrics.protocol");
}

@AfterAll
public static void afterAll() {
DubboBootstrap.reset();
System.clearProperty("dubbo.metrics.protocol");
}

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@
import org.springframework.context.annotation.PropertySource;

/**
* Zookeeper Dubbo Spring Provider Bootstrap
* Zookeeper Dubbo Spring Consumer Bootstrap
*
* NOTE: For production/business usage, this sample should be converted to a normal Spring Boot application
* instead of directly loading the application context in the main method. For business applications:
* <ol>
* <li>Create a proper Spring Boot application with @SpringBootApplication annotation</li>
* <li>Use application.properties or application.yml for configuration</li>
* <li>Deploy as a standalone JAR or WAR file</li>
* <li>Use proper application lifecycle management</li>
* </ol>
* This bootstrap is primarily intended for testing and demonstration purposes.
*
* @since 2.7.8
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
/**
* Zookeeper Dubbo Spring Provider XML Bootstrap
*
* NOTE: For production/business usage, this sample should be converted to a normal Spring Boot application
* instead of directly loading the application context in the main method. For business applications:
* <ol>
* <li>Create a proper Spring Boot application with @SpringBootApplication annotation</li>
* <li>Use application.properties or application.yml for configuration</li>
* <li>Deploy as a standalone JAR or WAR file</li>
* <li>Use proper application lifecycle management</li>
* </ol>
* This bootstrap is primarily intended for testing and demonstration purposes.
*
* @since 2.7.8
*/
public class ZookeeperDubboSpringConsumerXmlBootstrap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
/**
* Zookeeper Dubbo Spring Provider Bootstrap
*
* NOTE: For production/business usage, this sample should be converted to a normal Spring Boot application
* instead of directly loading the application context in the main method. For business applications:
* <ol>
* <li>Create a proper Spring Boot application with @SpringBootApplication annotation</li>
* <li>Use application.properties or application.yml for configuration</li>
* <li>Deploy as a standalone JAR or WAR file</li>
* <li>Use proper application lifecycle management</li>
* </ol>
* This bootstrap is primarily intended for testing and demonstration purposes.
*
* @since 2.7.8
*/
@EnableDubbo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,25 @@ protected void storeConsumerMetadataTask(
public void destroy() {
if (reportCacheExecutor != null) {
reportCacheExecutor.shutdown();
try {
if (!reportCacheExecutor.awaitTermination(5, TimeUnit.SECONDS)) {
reportCacheExecutor.shutdownNow();
}
} catch (InterruptedException e) {
reportCacheExecutor.shutdownNow();
Thread.currentThread().interrupt();
}
}
if (reportTimerScheduler != null) {
reportTimerScheduler.shutdown();
try {
if (!reportTimerScheduler.awaitTermination(5, TimeUnit.SECONDS)) {
reportTimerScheduler.shutdownNow();
}
} catch (InterruptedException e) {
reportTimerScheduler.shutdownNow();
Thread.currentThread().interrupt();
}
}
if (metadataReportRetry != null) {
metadataReportRetry.destroy();
Expand Down Expand Up @@ -547,6 +563,14 @@ void cancelRetryTask() {
retryScheduledFuture.cancel(false);
}
retryExecutor.shutdown();
try {
if (!retryExecutor.awaitTermination(5, TimeUnit.SECONDS)) {
retryExecutor.shutdownNow();
}
} catch (InterruptedException e) {
retryExecutor.shutdownNow();
Thread.currentThread().interrupt();
}
}

void destroy() {
Expand Down
Loading