Skip to content


Using ColdFusion Event Gateways: A Couple of Gotcha’s

Though I’m still working on some code which uses the new CFML Asynchronous Gateway as part of the Event Gateways in the newly released ColdFusion MX 7.0, I thought I’d post a couple of things I’ve came across to be aware of.

When using the Developer edition of CFMX 7.0, the Gateway functionality is limited. I understand this to mean that you can only fire off 10 event gateways within one request, but feel free to correct me if you find something different with that yourself. Also, Tim Buntel answered a question I had about it on CF-Talk with a little more detail about how it’s limited: “Enterprise Gateway architecture is limited in message handling capability in Developer mode, and individual Gateways are limited to a single incoming OriginatorID (SMS, IM buddy, etc).

It appears that CFML Asynchronous Gateway requests are actually routed as internal requests to it’s version of Apache Axis (which is what ColdFusion uses for webservices). (Samuel Neff pointed out that this is now false– see comments below. Thanks Sam!) So for instance if your application has anything dependent on Form or URL variables in the event which you are calling, it will not be able to “find” them. An example of this– I’ve wrote something which “cleans” URL and Form variables on each client request that is ran from Application.cfm before any application logic is called. As such, when I made requests via the Event Gateway it would get stuck in that particular part of the application because it couldn’t find any URL or Form variables. I just added an if statement around that piece of code to check for the existence of the Form and URL scopes which fixed the problem.

I’m sure I’ll have plenty to write about Event Gateways in the days ahead, but figured I’d put these gotcha’s out there while they were still on my mind.

Posted in ColdFusion.

3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Async code is run from a gateway thread and is not part of any request. If it needs data from the request that originated the call then you need to pass it. You can, for example, pass a duplicated structure of the Form variables.

    Also, where did you get the info about Axis being used with async gateways? Last I looked into the async functionality it just used the gateway mechanism and had nothing to do with axis.

  2. The last time I looked at the CFCProxy mechanism in CFMX, it looked like it was calling Apache Axis. Granted it’s been awhile since I’ve looked at it.. I’ll double check that when I get a chance.

  3. I just checked it out and you’re correct– good catch. It does still invoke the request independently, but it doesn’t use Axis to proxy to the CFC any longer. I believe it’s been updated since the last time I looked at it closely (which was early during the beta period), or of course it’s entirely possible I was looking at the wrong thing altogether way back when (I’ll have to fire up an old beta to see). I’ll update my post. Thanks Sam.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.