-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Spring Data's Repository interface #317
Comments
I think this is supposed to already work that way, hence the bug label. |
Update: This does work usually. I have not yet been able to identify why it doesn't work in your project. You could help us by slimming down the project to a minimum viable reproducer. |
@F43nd1r I slimmed down one of your sample apps and it seems it does not work on my box: https://github.com/jonatan-ivanov/chaos-monkey-spring-boot/tree/spring-data-jpa-demo A few notes for the demo app:
Please let me know if you were able to repro the issue with this sample. |
Your demo works as expected for me. Please note that enabling multiple assaults (exception and latency) means one will be picked at random, so not every request fails. |
This issue was marked as stale because it has been open and waiting for feedback for 60 days with no activity. If no feedback is provided within 14 days, this will be closed. |
@jonatan-ivanov This is probably fixed with #335. It works with the latest snapshot (instructions here. Would be great if you let usknow if it works in your use case as well :) |
As far as I know (and as it is documented), the repository watcher (
chaos.monkey.watcher.repository
) only supports the@Repository
stereotype.There are use-cases where repositories are created without the user annotating them with the
@Repository
annotation.E.g.: Spring Data JPA, Spring Data Rest, etc. generates implementation for interfaces that extend
org.springframework.data.repository.Repository
(or one of it's sub-interface likeCrudRepository
orPagingAndSortingRepository
). These repositories are not watched by the repository watcher.Expected Behavior
org.springframework.data.repository.Repository
instances should be watched ifchaos.monkey.watcher.repository
is set totrue
.Current Behavior
org.springframework.data.repository.Repository
instances are not watched ifchaos.monkey.watcher.repository
is set totrue
.Possible Solution
I'm not very familiar with the internals of the projects but loosening the predicate that decides if a bean is watched or not during scanning should solve this (I guess).
Steps to Reproduce
I think this is by-design but
here's a reproducer; you need to re-enable chaos-monkey and set
chaos.monkey.watcher.repository=true
.Context (Environment)
I would like to inject errors and latency inside of my application close to the DB.
I'm using Spring Boot 2.7.0 (latest right now)
The text was updated successfully, but these errors were encountered: