Charles Robertson
04/18/2023, 7:32 PMListener Component and a Custom CFC path to the CFC field
When I make the following call:
SendGatewayMessage(“eventName”, data)
The data gets passed to the AsynchronousEvents.cfc -> AsynchronousEventsListener.cfc ~ OnIncomingMessage()
But the data never gets sent to my Custom CFC via the method OnIncomingMessage()
Does anyone know why?bdw429s
04/18/2023, 7:38 PMbdw429s
04/18/2023, 7:38 PMbdw429s
04/18/2023, 7:39 PMbdw429s
04/18/2023, 7:39 PMbdw429s
04/18/2023, 7:40 PMbdw429s
04/18/2023, 7:40 PMbdw429s
04/18/2023, 7:41 PMCharles Robertson
04/18/2023, 7:47 PMbdw429s
04/18/2023, 7:47 PMbdw429s
04/18/2023, 7:48 PMbdw429s
04/18/2023, 7:48 PMbdw429s
04/18/2023, 7:48 PMbdw429s
04/18/2023, 7:50 PMsendGatewayMessage() 100,000 times in a row, Adobe would queue up those events and then process them out of that queue using a preset number of threads (limited by wither you're on CF Enterprise or CF Standard 😆 )bdw429s
04/18/2023, 7:50 PMbdw429s
04/18/2023, 7:50 PMbdw429s
04/18/2023, 7:52 PMthread {
myComponent.doSomething()
}bdw429s
04/18/2023, 7:53 PMCharles Robertson
04/18/2023, 7:54 PMAsynchronousEvents.cfc -> SendMessage, but actually the cfthread start & end tag were commented out.
It was like someone thought let’s make it async, because it is inside a component with the title AsynchronousEvents 🤣 and the decided against it.
So, I am not sure the one in Lucee 5+, is actually Asynchronous? 😵💫bdw429s
04/18/2023, 7:55 PMwhile(true) loop is either in the start method. Honestly, I'm not sure anyone who touched this knows what they were doing, lolbdw429s
04/18/2023, 7:56 PMbdw429s
04/18/2023, 7:56 PMCharles Robertson
04/18/2023, 7:58 PMCharles Robertson
04/18/2023, 8:02 PMgetListener().onIncomingMessage(local.event);
Is that referring to:
AsynchronousEventsListener.cfc -> onIncomingMessage()
Or:
CustomCFC -> onIncomingMessage()bdw429s
04/18/2023, 8:03 PMbdw429s
04/18/2023, 8:04 PMbdw429s
04/18/2023, 8:04 PMbdw429s
04/18/2023, 8:04 PMbdw429s
04/18/2023, 8:05 PMbdw429s
04/18/2023, 8:06 PMbdw429s
04/18/2023, 8:07 PMsleep(10000) in your listener and see if the sendGatewayMessage() blocks for 10 seconds or returns right awayCharles Robertson
04/18/2023, 8:08 PMbdw429s
04/18/2023, 8:09 PMbdw429s
04/18/2023, 8:10 PMbdw429s
04/18/2023, 8:10 PMbdw429s
04/18/2023, 8:10 PMbdw429s
04/18/2023, 8:11 PMCharles Robertson
04/18/2023, 8:12 PMbdw429s
04/18/2023, 8:13 PMbdw429s
04/18/2023, 8:13 PMbdw429s
04/18/2023, 8:14 PMgetListener().onIncomingMessage(local.event);
will actually call your codebdw429s
04/18/2023, 8:15 PMcore\src\main\java\resource\context\admin\gdriver\AsynchronousEvents.cfcCharles Robertson
04/18/2023, 8:18 PMCharles Robertson
04/18/2023, 8:32 PM/la_reporting/model/RunReport.cfc
Is a mapping path, by the way. It is one directory above the webroot, which is why I cannot use normal CFC path dot notation.
And now I get:
"INFO","XNIO-1 task-2","04/18/2023","21:28:27","lucee_context5.3.9.166","Event Gateway reportinggateway stopping"
"INFO","Thread-144","04/18/2023","21:28:27","lucee_context5.3.9.166","Event Gateway reportinggateway stopped"
"INFO","XNIO-1 task-2","04/18/2023","21:28:27","lucee_context5.3.9.166","Asyn CFC initialized path /la_reporting/model/RunReport.cfc"
"INFO","Thread-279","04/18/2023","21:28:28","lucee_context5.3.9.166","Event Gateway reportinggateway started"
"INFO","Thread-286","04/18/2023","21:28:31","lucee_context5.3.9.166","Event Gateway reportinggateway stopping"
"INFO","Thread-279","04/18/2023","21:28:31","lucee_context5.3.9.166","Event Gateway reportinggateway stopped"
"INFO","Thread-286","04/18/2023","21:28:31","lucee_context5.3.9.166","Event Gateway reportinggateway started"
"INFO","XNIO-1 task-9","04/18/2023","21:28:47","lucee_context5.3.9.166","sendMessage - Event Listener"
"INFO","XNIO-1 task-9","04/18/2023","21:28:47","lucee_context5.3.9.166","Event Gateway Component [lucee.extension.gateway.AsynchronousEvents] has no accessible Member with name [LISTENER]"bdw429s
04/18/2023, 8:36 PMbdw429s
04/18/2023, 8:36 PMCharles Robertson
04/18/2023, 8:36 PM\lucee-5.3.9.166\WEB-INF\lucee-web\components\lucee\extension\gateway\AsynchronousEventsListener.cfc
\lucee-5.3.9.166\WEB-INF\lucee-web\components\lucee\extension\gateway\AsynchronousEvents.cfc
So currently I have written a replacement for the listener, at:
la\Reporting\model\RunReport.cfc
But now I need to create a 2nd custom CFc to replace:
\lucee-5.3.9.166\WEB-INF\lucee-web\components\lucee\extension\gateway\AsynchronousEvents.cfc
Something like:
la\Reporting\model\RunReportEvent.cfcCharles Robertson
04/18/2023, 8:37 PMlucee.extension.gateway.AsynchronousEventsListenerCharles Robertson
04/18/2023, 9:37 PMcfthread in situ.bdw429s
04/18/2023, 10:01 PMbdw429s
04/18/2023, 10:02 PMbdw429s
04/18/2023, 10:02 PMC:\Users\Brad\.CommandBox\server\8A7BBDE95D7EC758F1D472B86AF89506-asyncgateway\lucee-5.3.10.120\WEB-INF\lucee-web\components\lucee\extension\gateway\AsynchronousEvents.cfcbdw429s
04/18/2023, 10:03 PMsendGatewayMessage( 'test', { 'brad' : 'wood' } )
puts the following message
"INFO","XNIO-1 task-5","04/18/2023","16:52:21","lucee_context5.3.10.120","CFMLAysncListener onIncomingMessage -Event Listener"
in the this log file
C:\Users\Brad\.CommandBox\server\8A7BBDE95D7EC758F1D472B86AF89506-asyncgateway\lucee-5.3.10.120\WEB-INF\lucee-web\logs\AsynGateWay.logbdw429s
04/18/2023, 10:04 PMlistener.cfc and created this configbdw429s
04/18/2023, 10:04 PMbdw429s
04/18/2023, 10:05 PMbdw429s
04/18/2023, 10:06 PMpublic void function onIncomingMessage(struct CFEVENT={}){
systemOutput( arguments, 1 )
}
and running the same code as above put this in my console
[INFO ] {"CFEVENT":{"DATA":{"brad":"wood"},"ORIGINATORID":"1BAB936D-2C2E-4965-9E145804DF9E931B","GATEWAYTYPE":"","HOSTNAME":"DESKTOP-IAN6MSO","CFCPATH":"","CFCMETHOD":"","TIMEOUT":"","METHOD":""}}bdw429s
04/18/2023, 10:06 PMbdw429s
04/18/2023, 10:11 PMC:\Users\Brad\.CommandBox\server\8A7BBDE95D7EC758F1D472B86AF89506-asyncgateway\lucee-5.3.10.120\WEB-INF\lucee-web\components\lucee\extension\gateway\AsynchronousEvents.cfc
and
C:\Users\Brad\.CommandBox\server\8A7BBDE95D7EC758F1D472B86AF89506-asyncgateway\lucee-5.3.10.120\WEB-INF\lucee-server\context\context\admin\gdriver\AsynchronousEvents.cfc
which removed the superfluous CFC path and fixed the stupid while/true loop of doombdw429s
04/18/2023, 10:12 PMbdw429s
04/18/2023, 10:19 PMrunning. I honestly have no clue what the purpose of that ever was for.bdw429s
04/18/2023, 10:22 PMbdw429s
04/18/2023, 10:24 PMdata into a visible scope-- likekly why someone commented it out in the first place because they wouldn't get it working, lolbdw429s
04/18/2023, 10:25 PMthread data=data{
local.event ={
...
Data = attributes.data,
...
};
log text="sendMessage - Event Listener HostName..." file=this.logfile;
getListener().onIncomingMessage(local.event);
}bdw429s
04/18/2023, 10:25 PMbdw429s
04/18/2023, 10:26 PMCharles Robertson
04/18/2023, 11:21 PMCharles Robertson
04/19/2023, 6:25 AMCharles Robertson
04/19/2023, 10:19 AM"INFO","main","04/19/2023","11:07:59","lucee_context5.3.9.166","Asyn CFC initialized path /la_reporting/model/RunReport.cfc"
"INFO","main","04/19/2023","11:07:59","lucee_context5.3.9.166","Asyn CFC initialized path C:\domains\acf-lucee-shared\shared\la\CF-INF\cfcomponents\la\RefreshCandidateManagerCache.cfc"
"INFO","Thread-4","04/19/2023","11:07:59","lucee_context5.3.9.166","Event Gateway reportinggateway started"
"INFO","Thread-5","04/19/2023","11:07:59","lucee_context5.3.9.166","Event Gateway refreshcandidatemanagercache started"
"INFO","XNIO-1 task-7","04/19/2023","11:14:24","lucee_context5.3.9.166","sendMessage - Event Listener"
"INFO","XNIO-1 task-7","04/19/2023","11:14:24","lucee_context5.3.9.166","Event Gateway Component [lucee.extension.gateway.AsynchronousEvents] has no accessible Member with name [LISTENER]"
But there is no mention of lucee.extension.gateway.AsynchronousEvents in the:
Web admin -> Event Gateway -> reportinggatewayCharles Robertson
04/19/2023, 10:20 AMCharles Robertson
04/19/2023, 11:01 AMC:\Users\ADMCharlesr\.CommandBox\server\A39A87EE2EFB28FAFA02EAB99EA6149F-system_learningassistant_lucee\lucee-5.3.9.166\WEB-INF\lucee-web\components\lucee\extension\gateway\AsynchronousEvents.cfc
Is having problems, finding my listener:
la\Reporting\model\RunReport.cfc
Now let me explain my custom listener's path:
Listener Component = la_reporting.model.RunReport
la_reporting is a server level mapping:Charles Robertson
04/19/2023, 11:07 AMwebroot = la\Code
But I have tested with a custom listener that is in the webroot, and it still cannot find it?Charles Robertson
04/19/2023, 11:19 AM"INFO","XNIO-1 task-11","04/19/2023","12:17:25","lucee_context5.3.9.166","Event Gateway ERROR Component [lucee.extension.gateway.AsynchronousEvents] has no accessible Member with name [LISTENER]"Charles Robertson
04/19/2023, 11:38 AMC:\Users\ADMCharlesr\.CommandBox\server\A39A87EE2EFB28FAFA02EAB99EA6149F-system_learningassistant_lucee\lucee-5.3.9.166\WEB-INF\lucee-web\components\lucee\extension\gateway\AsynchronousEvents.cfc -> init()
It spits out the default listener rather than the custom listener?Charles Robertson
04/19/2023, 11:43 AMCharles Robertson
04/19/2023, 11:45 AMListener, in it?bdw429s
04/19/2023, 1:46 PMbdw429s
04/19/2023, 1:47 PMbdw429s
04/19/2023, 1:47 PMbdw429s
04/19/2023, 1:48 PMwriteDump(var="#arguments#", output="C:\Users\HP\Desktop\test.html", format ="classic");
that will error on your machine 🙂bdw429s
04/19/2023, 1:49 PMbdw429s
04/19/2023, 1:50 PMbdw429s
04/19/2023, 1:50 PMbdw429s
04/19/2023, 1:51 PMzackster
04/19/2023, 1:53 PMCharles Robertson
04/19/2023, 4:46 PMSendGatewayMessage(), as Brad suggested...🙂