Skip to content

Tag: spring

How to add a field from body to a condition

I use the @StreamListener annotation to listen to the topic. How can I add a field from body to the condition? An example of an entity that is sent to the topic: Answer As you can see from version 3.0, you should avoid using filtering based on the message payload. Notice these lines from the documentation: The preceding code is

Method annotated with @Bean is called directly – function calling a bean in a @Service class

I just get an error over and over inside the function “save” that is saying: “Method annotated with @Bean is called directly. Use dependency injection instead.” when calling “passwordEncoder()” in this line user.setPassword(passwordEncoder().encode(user.getPassword())); What am I missing in the spring logic that it’s not working? BTW – followed the tut : Answer The ‘@Bean’ annotation is telling Spring

Spring data rest resource inconsistently ‘discovered’ after restart

I’m using Spring Data Rest to expose rest endpoints which i can use in my user interface. However, during testing I noticed that when hitting the base rest url (http://localhost:8080/rest) , the endpoints are inconsistently exposed. I’m using the Annotation based RepositoryDetectionStrategies. I would appreciate some assistance in understanding and resolving the issue. Example: First boot: all endpoints are properly