Putting CFMX’s Event Gateway to Good Use

I found a very nice way to use CFMX’s asynchronous event gateways. I’m working on an import tool of sorts that spiders a site and generates a Google sitemap XML document. Once the sitemap is generated, all the URLs are requested one by one and then parsed for the various content we need. Now, without the new asynch gateways we’d have to either site there and wait, which would be completely impractical, or generate the sitemap and then have a (unreliable!) scheduled task handle the job. The event gateway is nice because the request is generated and the processing begins immediately. And since the request is asynchronous, the user gets a response right away. At the end of the process the content of the request are emailed to the user.

I did run into some quirks while getting it up and running. The docs state that:

Note: You do not have to restart the event gateway instance when you make changes to a CFC. ColdFusion MX automatically uses the updated CFC when the next event occurs.

However, that didn’t seem to be the case for me. I tried removing the generated class files, restarting the service, resetting the gateway instance, but nothing seemed to allow CF to see the changes in my CFC. What worked for me was removing *all* the class files (found here: CFusionMX7\wwwroot\WEB-INF\cfclasses).

Post a Comment

Your email is never published nor shared. Required fields are marked *

*

*