exam questions

Exam 2V0-72.22 All Questions

View all questions & answers for the 2V0-72.22 exam

Exam 2V0-72.22 topic 1 question 24 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 24
Topic #: 1
[All 2V0-72.22 Questions]

Which two statements are correct regarding Spring Boot auto-configuration customization? (Choose two.)

  • A. Use the @AutoConfigureAfter or @AutoConfigureBefore annotations to apply configuration in a specific order.
  • B. Disable specific auto-configuration classes by using the exclude attribute on the @EnableAutoConfiguation annotation.
  • C. Provide customized auto-configuration by subclassing the provided Spring Boot auto-configuration classes.
  • D. Enable component scanning within auto-configuration classes to find necessary components.
  • E. Control the order of auto-configuration classes applied with @AutoConfigureOrder.
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Azuni
5 months, 1 week ago
Selected Answer: AB
I believe A and B is correct. The statement in A is exactly extracted from here: https://docs.spring.io/spring-boot/docs/3.0.0/reference/html/features.html#features.developing-auto-configuration.locating-auto-configuration-candidates B is correct as it is stated as one of the many ways to customize your auto-configuration. C is not correct as you can't just create a subclass of the auto-configuration class and expect it to work. You need to import that parent auto-configuration into a configuration of your own. D is incorrect as component scanning has nothing to do with this. E is actually also correct. We have to chose only 2, I looked at which statement between A and E were exactly the same as in the Spring Docs. A was exactly the same as in the documentation. This is a very peculiar question as it's answers are not really in the studying material, except for answer B.
upvoted 3 times
quakquak3
1 month, 1 week ago
I don't see why E is not also correct. I would have voted ABE if it was possible. If your configuration needs to be applied in a specific order, you can use the before, beforeName, after and afterName attributes on the @AutoConfiguration annotation or the dedicated @AutoConfigureBefore and @AutoConfigureAfter annotations. For example, if you provide web-specific configuration, your class may need to be applied after WebMvcAutoConfiguration. https://docs.spring.io/spring-boot/docs/3.0.0/reference/html/features.html#features.developing-auto-configuration.locating-auto-configuration-candidates mentions both A and E: "If you want to order certain auto-configurations that should not have any direct knowledge of each other, you can also use @AutoConfigureOrder. That annotation has the same semantic as the regular @Order annotation but provides a dedicated order for auto-configuration classes."
upvoted 1 times
...
...
rhuanca
9 months, 3 weeks ago
B and C . A. The @AutoConfigureAfter, @AutoConfigureBefore, and @AutoConfigureOrder annotations are used to control the order in which auto-configuration classes are applied, not to apply configuration in a specific order
upvoted 2 times
Azuni
5 months, 1 week ago
It can't be C. It is not enough to simply subclass an auto-configuration class. It needs to be the same type of BEAN as the auto-configured bean. Not just the class.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago