example configure application name : spring: application: name: example but How do you do this with @bean?

Comment From: wilkinsona

You can't set it with a bean as it would happen too late. Among other things spring.application.name is used to set the application context's ID and that happens before any beans in the context are created.

If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.