The ManagedChannel here is not closed properly upon application context close, and may produce a warning:
i.g.i.ManagedChannelOrphanWrapper : *~*~*~ Channel ManagedChannelImpl{logId=1, target=dns:///104.154.63.246:32819} was not shutdown properly!!! ~*~*~*
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
ManagedChannel should be produced as a bean w/ destroy method specified, so that Spring can shutdown/destroy the managed channel.
Describe the bug https://github.com/spring-cloud/spring-cloud-gcp/blob/master/spring-cloud-gcp-autoconfigure/src/main/java/org/springframework/cloud/gcp/autoconfigure/pubsub/GcpPubSubEmulatorAutoConfiguration.java#L48
The
ManagedChannel
here is not closed properly upon application context close, and may produce a warning:ManagedChannel should be produced as a bean w/
destroy
method specified, so that Spring can shutdown/destroy the managed channel.Sample https://github.com/saturnism/testcontainers-gcloud-examples/blob/main/springboot/pubsub-example/src/test/java/com/example/springboot/pubsub/PubSubIntegrationTests.java
Run with
mvn verify
to run the integration test and observe the error.