Skip to content

Commit 099b582

Browse files
anguillanneufkurtisvg
authored andcommitted
[Pubsub] Add cleanup of background threads (GoogleCloudPlatform#1247)
* Shut down daemon threads Adding `-Dexec.cleanupDaemonThreads=false` in `mvn exec:java` fixes `java.lang.IllegalThreadStateException`. * Undo changes in commands * Add cleanupDaemonThreads in pom
1 parent fd030d1 commit 099b582

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

pubsub/cloud-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Publishes 5 messages to the topic `my-topic`.
4747
```
4848
mvn exec:java -Dexec.mainClass=com.example.pubsub.SubscriberExample -Dexec.args=my-sub
4949
```
50-
Subscriber will continue to listen on the topic and print out message id and data as messages are received. Press `Ctrl+C` to exit the application.
50+
Subscriber will continue to listen on the topic and print out message id and data as messages are received. Press `Ctrl+C` to exit the application.
5151

5252
#### Testing
5353
Run the test with Maven.

pubsub/cloud-client/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,30 @@
5656
<version>0.42</version>
5757
<scope>test</scope>
5858
</dependency>
59+
<dependency>
60+
<groupId>org.apache.maven</groupId>
61+
<artifactId>maven-plugin-api</artifactId>
62+
<version>3.3.3</version>
63+
</dependency>
5964
</dependencies>
65+
66+
<build>
67+
<plugins>
68+
<plugin>
69+
<groupId>org.codehaus.mojo</groupId>
70+
<artifactId>exec-maven-plugin</artifactId>
71+
<version>1.6.0</version>
72+
<executions>
73+
<execution>
74+
<goals>
75+
<goal>java</goal>
76+
</goals>
77+
</execution>
78+
</executions>
79+
<configuration>
80+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
81+
</configuration>
82+
</plugin>
83+
</plugins>
84+
</build>
6085
</project>

0 commit comments

Comments
 (0)