Bird
0
0

Why does this custom actuator endpoint fail to expose data?

medium📝 Debug Q7 of 15
Spring Boot - Actuator
Why does this custom actuator endpoint fail to expose data? @Component @Endpoint(id = "info") public class InfoEndpoint { public String details() { return "Details"; } } Accessing /actuator/info returns 404.
AThe method lacks @ReadOperation annotation to expose it
BThe class is missing @Endpoint annotation
CThe @Component annotation is misplaced
DThe endpoint id "info" conflicts with default endpoints
Step-by-Step Solution
Solution:
  1. Step 1: Check method annotations

    The method details() is not annotated with @ReadOperation, so it is not exposed.
  2. Step 2: Confirm class annotations

    The class has @Component and @Endpoint correctly.
  3. Final Answer:

    The method lacks @ReadOperation annotation to expose it -> Option A
  4. Quick Check:

    Methods need @ReadOperation to be exposed [OK]
Quick Trick: Annotate methods with @ReadOperation to expose them [OK]
Common Mistakes:
  • Assuming class annotations expose methods automatically
  • Thinking @Component alone exposes methods
  • Confusing endpoint id conflicts with method exposure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes