• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 31. Event Gateways > Creating an Initiator Application Using the ColdFu...

Creating an Initiator Application Using the ColdFusion Gateway

So far, you've seen how to create a responder application that listens for events from an event gateway instance and takes some sort of action. Now we'll study an application called an initiator application that sends a message to an event gateway. This example uses the ColdFusion Gateway to asynchronously log messages to a file via a simple CFC.

Logging may seem trivial, especially since you can just use CFLOG, but CFML pages that use CFLOG to write large amounts of data to a log file can seriously degrade an application's performance, as well as tie up threads that could be better used serving your application's Web users. In addition, you might have an application like a B2B that needs to log large amounts of information, such as every type of transaction between partners for legal reasons. Thus you might want to decouple logging into its own subsystem, not only for performance but for good design. Using the ColdFusion Gateway allows you to create applications that call CFCs asynchronously, which is perfect for this example. Okay; let's look at some code (Listing 31.2)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint