You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Path("/hello")
public class GreetingResource {
@Inject
Foo foo;
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return foo.foo();
}
}
Start the app: quarkus dev
In another terminal: curl localhost:8080/hello
Observe the logs (post-construct is invoked on the bean & decorator):
INFO [org.acm.DecoratorReproducer$FooDecorator] (executor-thread-1) PostConstruct
INFO [org.acm.DecoratorReproducer$FooImpl] (executor-thread-1) PostConstruct
INFO [org.acm.DecoratorReproducer$FooDecorator] (executor-thread-1) foo
Shutdown the app: [h], [q]
Observe the logs (pre-destroy is invoked on the bean only):
INFO [org.acm.DecoratorReproducer$FooImpl] (Shutdown thread) PreDestroy
INFO [io.quarkus] (Shutdown thread) code-with-quarkus stopped in 0.018s
Output of uname -a or ver
Darwin [snip] 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6020 arm64
Output of java -version
openjdk version "11.0.19" 2023-04-18 OpenJDK Runtime Environment Temurin-11.0.19+7 (build 11.0.19+7) OpenJDK 64-Bit Server VM Temurin-11.0.19+7 (build 11.0.19+7, mixed mode)
GraalVM version (if different from Java)
n/a
Quarkus version or git rev
3.4.3
Build tool (ie. output of mvnw --version or gradlew --version)
Describe the bug
@PostConstruct
methods are honoured on@Decorator
classes but@PreDestroy
methods are not.Expected behavior
If a valid pre-destroy method is present on a decorator class it is invoked on application shutdown.
Actual behavior
The decorator pre-destroy method is not invoked
How to Reproduce?
quarkus create app
GreetingResource
:quarkus dev
curl localhost:8080/hello
[h]
,[q]
Output of
uname -a
orver
Darwin [snip] 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6020 arm64
Output of
java -version
openjdk version "11.0.19" 2023-04-18 OpenJDK Runtime Environment Temurin-11.0.19+7 (build 11.0.19+7) OpenJDK 64-Bit Server VM Temurin-11.0.19+7 (build 11.0.19+7, mixed mode)
GraalVM version (if different from Java)
n/a
Quarkus version or git rev
3.4.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39) Maven home: [snip]/.m2/wrapper/dists/apache-maven-3.8.8-bin/67c30f74/apache-maven-3.8.8 Java version: 17.0.7, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "13.6", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: