I have a custom interceptor which I fire via:
announceInterception(state=“onRBChange”,interceptData={ id=prc.resource.getID(), rbID=prc.resource.getRbID() }, async=true);
The first line of the onRBChange() function is a call to logbox so I can trace that the interception fired.
public void function onRBChange(event,interceptData) {
logbox.getLogger(“default”).info(“onRBChange announced!”);
// etc
return;
}
This has been working perfectly but when I updated to CB 3.7.0 it stopped working. When I run the event that calls the announceInterception nothing is written to the log (and the rest of the intercept code is not executed either). The bizarre thing is it does work maybe one out of every ten times.
Rolling back to CB 3.6.1 fixes the problem, it works consistently again. Also, it will work consistently in 3.7.0 if I remove async:true. I’m on Railo 4.1.1.000 RC.
Any ideas?
Can you put a cflog or cfmail at the very top of the interceptor to see if it’s even getting called. I’m curious if there’s an error that’s happening in ti that’s getting lost.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Do you mean in the constructor or in the config() method?
I’m back on 3.6.1 at the moment, I added a cfmail to the constructor, but I only get the test email when I reinit the app. It doesn’t go out when I announce the interception even though the intercept code is running (the log message is written, etc).
I could reduce the entire interceptor temporarily to just that onRBChange function and make the function do nothing but write to the log.
Would that help?
No, I mean in the actual onRBChange method itself-- the one that gets called when your custom interception point in announced. The constructor is only called once when the framework initializes the interceptor.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Luis, it only fails when async=true.
It works all the time when async=false.
OK, yep I get it. I added cfmail as the first line of the onRBChange() function. The call to logbox is the second line, BTW.
On CB 3.7.0:
With announceInterception(…,async=true), no email is sent.
With announceInterception(…,async=false), I get the email, the log is written, and the rest of the function runs as expected.
On CB 3.6.1:
With announceInterception(…,async=true), I get the email, the log is written, and the rest of the function runs as expected.
With announceInterception(…,async=false), I get the email, the log is written, and the rest of the function runs as expected.
Verified this fixed my problem! Thanks for the quick response Luis and Brad. \m/ you rock \m/