Async Aspect of RequestScope bean #8660
Unanswered
satya-devloper
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was using 2.3.3 micronaut earlier and my code was like this
@requestScope
class myrequestbean implement observable{
string val;
set value(string val) {this.val=val}
get value() {return this.val}
subscribe(){
sopln(this.val)
}
}
controller code
myrequestbean mrb;
get("/")
public func(string val){
mrb.setvalue(val)
observable.subscribe()
return val;
}
This seems to work fine, but after upgrading to 3.7.5 it seems before value sets in mrb.setvalue(), subscribe method gets called and when it try to print this.val in subscribe method , it is printing null.
Not sure why earlier this not came and after upgrade came this issue. Is there any update in requestScope for this type of behaviour?
Also it is not coming every time, in 100 time frequency is almost 6 to 7 times.
Beta Was this translation helpful? Give feedback.
All reactions