Problem with Bean Selection
- do not apply @service annotation to the stripepaymentservice
Solutions
@Primary
- application run properly
- we cannot apply primary to multiple classes. we can only have a single primary
@Qualifier
- inorder to use @Qualifier we have to assign a name to our bean
Example Implementation
Externalizing Configuration
- we don’t wanna hard code values like apiUrl, apiKey
- we should store them in application properties
- press CTRL+SPACE in intellij to see the available properites
- values doesn’t have to be only strings
- you can also give a default value
- if there is not stripe.timeout value in properties file it will use the default 3000 value.
- if it is defined in the properties file it will be used
s
- we can also use a yaml file instead of properties file