-
Notifications
You must be signed in to change notification settings - Fork 125
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
Q: RuleBean execution results in full scan? #175
Comments
Yes, it does. This is done for thread safety. Although, perhaps there is a more elegant way to solve the problem. |
I'm looking into switching this to a single scan. But the instantiation of the POJOs that are found in the scan will still take place on every run and there is a little reflection involved there since it transforms a POJO class representation into a Rule via an adapter. |
There is an update in 0.12-SNAPSHOT that has a fix for this. |
@Clayton7510 is there a way to turn off scan logging? |
Sorry I didn't post this earlier. I worked around it before the 0.12-SNAPSHOT was posted. This is my code in Kotlin for setting up my rules. They have to be added in order of execution:
This will avoid full scans, but the onus is on setting up order properly. Everything worked well. We're running these rules potentially hundreds/thousands of times per second through Kotlin Coroutines. It's held up well. As a side note - this framework has been awesome for us. It allowed us to remove business rules into small, distinct, clear rules that are easy to update. The rest of our code is just calling out to these rules. I have smashed it with hundreds of threads simulating thousands of concurrent users. Didn't skip a beat! One of my favourite projects on Github by far. Good work has been done here, much appreciated. Thanks |
@Clayton7510 With all that said, I found a work-around. I think we can close this issue out from my perspective. |
Possible dupe of #155 |
Hi,
Just a small question - but does every invocation of "SpringAwareRuleBookRunner" result in a full package scan? These are the logs I am seeing:
Just a question.
Thanks for a nice framework for rules
The text was updated successfully, but these errors were encountered: