ColdFusion 9 Feature Idea: Multiple JVMs

A recent post on Brian Kotek's blog about future directions for ColdFusion sparked a lot of debate over whether or not ColdFusion should support AS3 server-side. I want to change the focus here a bit and talk about a feature I've been thinking about that would be potentially useful to a lot of people. I'd like to see ColdFusion 9 support deployment of various services across multiple JVMs - without having to have multiple instances of the full ColdFusion server.

Why would you want to do this? Let me lay out a few scenarios and see if this starts to make more sense. Imagine you have a ColdFusion application deployed on a 32-bit Windows server with 4 GB of memory. The ColdFusion application in question does a lot of XML manipulation and PDF document generation. If you've ever had a similar application in a similar environment, then you know that your ColdFusion application can really only make use of about 1.6 GB of RAM as that's a limit of the JVM on 32 bit platforms. You also know that both XML parsing and PDF document generation are very expensive operations, especially from a memory utilization perspective. Now imagine if you could configure your ColdFusion application such that it was able to off-load the PDF document generation and the XML parsing and transformation to separate JVMs. This would allow your core application to handle the majority of your application functionality while off-loading the processing intensive operations to separate specialized JVMs (as opposed to separate threads on the same JVM). The difference here is that the additional JVMs wouldn't require a full instance of the application server - just the specific processing parts that can be off-loaded. This is exactly how most Enterprise Service Buses deal with distributed processing and I think it would be a killer feature for ColdFusion to have in its bag of tricks.

Of course the benefit isn't limited to just memory limited JVM instances in 32 bit environments. In 64-bit environments, it makes just as much sense as you are still segmenting processing, allowing for better thread utilization, and potentially allowing you to scale out just the type of processing you need to.

What do you think? Does this make sense?

Tell Paul Kenney what should be included in the next version of CFCUnit

Paul Kenney is working on the next major release of his unit testing framework for ColdFusion, CFCUnit and is interested in hearing what you want to see in the release.

ColdFusion Portlet Toolkit Officially Released - Finally!!

This one has been a long time coming. Back in 2003, I blogged about how it would be really cool now that ColdFusion was built on top of Java for ColdFusion to support the portlet specifications outlined in JSR 168 & 170. I was really hoping they would release something for ColdFusion that made this as easy as wrapping code with a custom tag, or invoking a CFC. I also heard rumors that Macromedia had created a proof of concept for this at the request of a customer, but nothing was ever released.

As time went on, I shifted away from looking at a commercial portal (WebSphere) as a solution for some problems we were trying to solve, but I still keep an eye on developments in that space, as I never know when things may change and I could find myself looking at portals again.

All of this brings me to the point of this post. It looks like Adobe has released a proof of concept Portlet Toolkit for IBM Websphere and ColdFusion!

From the Adobe Labs website:

"The ColdFusion Portlet Toolkit is a proof-of-concept library that allows you to use ColdFusion as a Portal Application within an IBM WebSphere Portal Server (WSPS version 5 and greater). A Portal Application can serve several different portlets. Every portlet you deploy will run inside the same ColdFusion Portal Application. This toolkit provides one concrete Portlet called CFCPortlet. This Portlet simply passes the requests on to the ColdFusion server. The ColdFusion then invokes CFC methods to render the Portlet, and to perform actions. You can deploy several instances of this Portlet on your Portal Server. The setting cfcName defines which CFC will be used to marshal the Portlet events."

I think this opens up a lot of cool possibilities for ColdFusion developers working at companies who have also deployed Websphere portals. Although this release is Websphere specific, I would think it wouldn't be that difficult for Adobe to port the library for other portal implementations (like Apache Jetspeed). Now I just wish I had a Websphere portal so I could play with this thing!

My Scorpio (ColdFusion 8) Wishlist

At the urging of several people, I've taken my Blackstone Wishlist, stripped out requests that made it into CFMX 7, 7.0.1, and 7.0.2 as well as requests that have already been mentioned on a plethora of other blogs (many of which I would like to see), and came up with the following things I'd like to see considered for the ColdFusion MX 8 (Scorpio) release. Apologies for any requests that may have already been mentioned on other blogs.

Drum roll please (in no particular order)...

  1. I'd like to see a config file (CF, XML or otherwise) that runs when the server is restarted. This file could contain info on queries to automatically run and default variables to be assigned for the server or defined applications.
  2. Add functions to programmatically list all current sessions/applications on a server (without the Java workarounds we're currently using). Include info such as when the session/application was started, how long until expiration and whether or not it has already expired. Examples are getSessions(), getClients(), getApplications(), getSession(), getApplication(), etc
  3. Enhance the CF Scheduler so that it can operate in a cluster. I want to synchronize events between servers in a cluster so that you can setup a scheduled task on any server, and it would replicate out to all the other servers (similar to the buddy server concept), but the event would only fire on a single server, not on all of them at once
  4. Further enhance the cf scheduler to use its own thread count (as opposed to the one that's defined in the CF Admin now). This would allow the scheduler to use a different threading model than "active" applications on the server
  5. Ability to put a scheduled task on hold. Currently there's no way to temporarily disable the execution of a schedule task without deleting it (or changing the execution URL to a non existent page).
  6. Addition of weekday and weekend only durations. Currently, you can schedule a task to execute daily every n hours/minutes/seconds, but there's no way to specify you want this to occur only Monday through Friday (business days) or only on Saturday and Sunday. Sure you can code this into the pages you are executing, but that code has to be used with each task. It's much better if this can be made part of the scheduler.
  7. Task execution redundancy. Currently, if a scheduled task fails to execute (for instance if the server is being rebooted during execution time), there's no mechanism in place to automatically attempt to re-run a task. I've built this type of redundancy into several applications I've written that have scheduled tasks, but again, it has to be done on a per application/per server basis.
  8. Better reporting on task execution. I'd love to see a new column on the ColdFusion Administrator page for scheduled tasks that shows the last date/time the task was successfully executed as well as the next date/time the task was scheduled to execute. This would be invaluable for monitoring and troubleshooting.
  9. Deprecate cfscript. This would keep people from asking for more enhancements, when it's probably not going to happen. I used to be for enhancing cfscript, or throwing it out and allowing ActionScript in CF instead, but these days, I'm perfectly happy with all tags (I guess I'm mellowing out in my old age).
  10. Mechanism for dealing with name conflicts (overriding) with native CF functions/tags in order to future proof. So, if I already have a UDF called wrap(), upgrading my version of CF won't break my app when CF get's its own wrap() function
  11. Build stronger partnerships with companies like IBM, Actuate, etc to get support for CF into their products
  12. Make CF's security framework more granular. I always need an additional level of security beyond roles. How about groups, roles, and permissions. While you are at it, give us a way to programatically get a list of users currently logged in, their roles/permissions, etc
  13. Add IMAP, NNTP, and SNMP tags
  14. Since there is already support for Crystal Reports via cfreport, I'd like to see integration with Actuate too. It's J2EE based, so I would think that there are several integration points possible here.
  15. Add the Lotus Notes JDBC driver, free from IBM to the list of native drivers
  16. Fix reFind() and reFindNoCase() to return the positions for all matched subexpressions
  17. Spell check tag
  18. When a hotfix is applied, log it in a server var available in the CF Admin so that an admin can tell what hot fixes have been applied
  19. Add a TRACE attribute to CFQUERY for debugging so that we can see what CF is doing with the underlying JDBC driver. Most drivers have a trace capability that can be logged to a text file, but I'd like to see what's happening from a CF's perspective so I can see exactly what calls to my drivers it is making
  20. Scrap the JS validation in CFFORM and implement the qForms JS API from PengoWorks. It's much more powerful, flexible, and extensible and works very well with CF.
  21. Add an interface to the CF Admin to allow me to "reset" a datasource without having to restart the CF server. Right now, several of my iSeries DB2 data sources (JTOpen driver) occasionally hang. The rest of the CF server is fine as are the rest of my data sources. In order to free the hung data source, I have to restart my CF Application Server service. I would rather kill the connection to the hung data source and restart it (if that's how it works) without having to restart the server. It would be even better if I could to this programmatically, so I could call it from a cfcatch block if I detected the specific error a hang causes
  22. cfsocket tag (like in DRK5)
  23. Better caching than cfcache provides. See Brandon Purcel's CF_Accelerate. Not sure if you could replace cfcache with this or if it would be a new tag. I'd also like to see improved query caching options.
  24. In the CF Admin (and programmatically), give us a way to see and admin (expire) cached queries.
  25. Allow for mappings on an application level so that mappings defined in the CF Admin can apply to either the entire server, or a specific application.
  26. Official framework for unit testing CFCs
  27. Support for portlets as outlined in JSR 168 and JSR 170. I'd really like to see the ability to create a portlet in CFML, then have CF generate a WAR file for the portlet that can be deployed to any compliant portal server.
  28. Allow parameters for the JDBC URL to be passed dynamically at run time if possible. For example, right now, if I want to add an extra parameter to my data source just for testing, I can't do it from the cfquery tag. I have to go in and make the change in the CF Admin, and then change it back later if I want to "undo" it.
  29. Integrate with JMS (I know that Sean worked on an example JMS gateway, but I'd like to see it become "official")
  30. Allow sorting scheduled tasks within the CF Admin alphabetically by name, or time (interval). I have a server with 600+ scheduled tasks, and I'd like to group by time so I can tell whether I need to move any to a different time to avoid using too many of my server's available threads.
  31. Within a CFC method (and a UDF), allow us to VAR variables anywhere, not just at the beginning of the method. I often need to var a variable with a value that is dependant upon another condition (such as a conditional based on an argument being passed in). Because I have to var before any other cfml statements, I first have to var the variable and set it to empty (var=""), then do the conditional later. I'd like to see VAR implemented like in JavaScript. It would be great to var a loop variable inline, as opposed to at the top of the page for example
  32. Make it possible to deploy a "clone" of an existing instance of a CFMX deployment right from within the CF Admin of that instance. Similar to your archive and deploy, but have the deploy actually create the new instance and then clone the original
  33. Make it easier to tie a different jvm classpath to each instance of CFMX when using multiple instances.

Follow-on To Simon Horwith's Open Letter To The ColdFusion Server Team

First, I wanted to point out that Simon Horwith has written an Open Letter to the ColdFusion Server Team in which he outlines 25 features he would like to see implemented in ColdFusion 8 (Scorpio). I have to say that I agree with most of what Simon's asking for. In fact, if you take a look at My Blackstone Wishlist, which I put together back in 2004, you'll see many of the same feature requests (some of these made it into Blackstone, and some into Merimack).

This leads me to the question, what are the most important features Adobe customers would like to see in the next version of ColdFusion. Each new release brings with it a trade-off of cost vs. benefit. What's the biggest bang we can get for the buck in the next version of ColdFusion?

The ColdFusion Scheduler - What's Missing?

I use the ColdFusion scheduling service quite a bit. For one of our applications, we have over 500 scheduled tasks that execute daily, controlling the generation and distribution of reports. Because of the frequency with which I use the scheduler, I've compiled a list over the years of features I'd love to see added to the current implementation:

  • Ability to sort tasks in the ColdFusion Administrator view - by task name and by interval, both ascending and descending
  • Ability to put a scheduled task on hold. Currently there's no way to temporarily disable the execution of a schedule task without deleting it (or changing the execution URL to a non existent page).
  • Addition of weekday and weekend only durations. Currently, you can schedule a task to execute daily every n hours/minutes/seconds, but there's no way to specify you want this to occur only Monday through Friday (business days) or only on Saturday and Sunday. Sure you can code this into the pages you are executing, but that code has to be used with each task. It's much better if this can be made part of the scheduler.
  • Task execution redundancy. Currently, if a scheduled task fails to execute (for instance if the server is being rebooted during execution time), there's no mechanism in place to automatically attempt to re-run a task. I've built this type of redundancy into several applications I've written that have scheduled tasks, but again, it has to be done on a per application/per server basis.
  • Better reporting on task execution. I'd love to see a new column on the ColdFusion Administrator page for scheduled tasks that shows the last date/time the task was successfully executed as well as the next date/time the task was scheduled to execute. This would be invaluable for monitoring and troubleshooting.

I know that this list is by no means exhaustive. What would you like to see added to the ColdFusion scheduler?

My Blackstone Wishlist

I know several people have already blogged CF MX 7 (Blackstone) feature requests, but I figured I'd share the list of features I've been compiling. This list represents enhancements that I along with many other developers have been asking for, some of them going back several versions of CF. I've submitted this entire list to Macromedia, but I wanted to see what others out there think. I realize that some are much more doable than others, and that some of my requests fall within the category of "niche" feature, but I thought I would share nonetheless:

  1. tag for spawning multiple threads for asynch processing
  2. As mentioned by others, event based session/application/server functions: onSessionStart(), onSessionEnd(), onApplicationStart(), onApplicationEnd(), onServerStart() and onServerEnd(). Along these lines, I'd like to see an XML based config file that runs when the server is restarted. This XML file could contain info on queries to automatically run and default variables to be assigned for the server/applications
  3. Add functions to programmatically list all current sessions/applications on a server (without the Java workarounds we're currently using). Include info such as when the session/application was started, how long until expiration and whether or not it has already expired. Examples are getSessions(), getClients(), getApplications(), getSession(), getApplication(), etc
  4. Enhance the CF Scheduler so that it can operate in a cluster. I want to synchronize events between servers in a cluster so that you can setup a scheduled task on any server, and it would replicate out to all the other servers (similar to the buddy server concept), but the event would only fire on a single server, not on all of them at once
  5. Further enhance the cf scheduler to use its own thread count (as opposed to the one that's defined in the CF Admin now). This would allow the scheduler to use a different threading model than "active" applications on the server
  6. Add interfaces to CFCs
  7. cfconstructor tag for use in CFCs and deprecate the pseudo constructor area
  8. Deprecate cfscript and add ActionScript 2.0 support. You could easily do this by adding a new attribute called "language" to the cfscript tag where language="actionscript" or something like that. This way, existing cfscript would continue to work
  9. Overloading for functions and CFCs
  10. Mechanism for dealing with name conflicts (overriding) with native CF functions/tags in order to future proof. So, if I already have a UDF called wrap(), upgrading my version of CF won't break my app when CF get's its own wrap() function
  11. Build stronger partnerships with companies like IBM, Actuate, etc to get support for CF into their products
  12. Make CF's security framework more granular. I always need an additional level of security beyond roles. How about groups, roles, and permissions. While you are at it, give us a way to programatically get a list of users currently logged in, their roles/permissions, etc
  13. Add IMAP, NNTP, and SMTP tags
  14. Functions/tags for image manipulation
  15. Tags/functions for manipulating PDF. I saw the Max preview and was impressed with the cfdocument tag. I think this is a good start. I think for the report type, you also want to add Flash Paper in addition to HTML and PDF. Excel would rock.
  16. Since there is already support for Crystal Reports via cfreport, I'd like to see integration with Actuate too. It's J2EE based, so I would think that there are several integration points possible here.
  17. Add the Lotus Notes JDBC driver, free from IBM to the list of native drivers
  18. Tags/functions for dealing with Zip files
  19. Fix reFind() and reFindNoCase() to return the positions for all matched subexpressions
  20. Spell check tag
  21. Wrap up all hot fix in a Zero G installer so that they can easily be backed out. Also, when a hotfix is applied, log it in a server var available in the CF Admin so that an admin can tell what hot fixes have been applied
  22. JDO support if you can think of a way to do this
  23. Add a TRACE attribute to CFQUERY for debugging so that we can see what CF is doing with the underlying JDBC driver. Most drivers have a trace capability that can be logged to a text file, but I'd like to see what's happening from a CF's perspective so I can see exactly what calls to my drivers it is making
  24. Scrap the JS validation in CFFORM and implement the qForms JS API from PengoWorks. It's much more powerful, flexible, and extensible and works very well with CF.
  25. Add XMLDoc as a return types for methods in CFCs. Right now, you can't return a CF XML Document from a CFC as a native type
  26. Add an interface to the CF Admin to allow me to "reset" a datasource without having to restart the CF server. Right now, several of my iSeries DB2 data sources (JTOpen driver) occasionally hang. The rest of the CF server is fine as are the rest of my data sources. In order to free the hung data source, I have to restart my CF Application Server service. I would rather kill the connection to the hung data source and restart it (if that's how it works) without having to restart the server. It would be even better if I could to this programmatically, so I could call it from a cfcatch block if I detected the specific error a hang causes
  27. cfsocket tag (like in DRK5)
  28. Better caching than cfcache provides. See Brandon Purcel's CF_Accelerate. Not sure if you could replace cfcache with this or if it would be a new tag.
  29. In the CF Admin (and programmatically), give us a way to see and admin (expire) cached queries.
  30. Allow for mappings on an application level so that mappings defined in the CF Admin can apply to either the entire server, or a specific application.
  31. More metadata in the cfquery result set. I'd like to see the size (bytes) of the returned record set, column types, etc
  32. Official framework for unit testing CFCs
  33. Support for portlets as outlined in JSR 168 and JSR 170. I'd really like to see the ability to create a portlet in CFML, then have CF generate a WAR file for the portlet that can be deployed to any compliant portal server.
  34. Make the cfproperty tag actually define properties for CFCs as opposed to just for web services and meta data.
  35. Allow parameters for the JDBC URL to be passed dynamically at run time if possible. For example, right now, if I want to add an extra parameter to my data source just for testing, I can't do it from the cfquery tag. I have to go in and make the change in the CF Admin, and then change it back later if I want to "undo" it.
  36. Add XML validation against a DTD
  37. Integrate with JMS
  38. Allow sorting scheduled tasks within the CF Admin alphabetically by name, or time (interval). I have a server with 600+ scheduled tasks, and I'd like to group by time so I can tell whether I need to move any to a different time to avoid using too many of my server's available threads.
  39. Within a CFC method (and a UDF), allow us to VAR variables anywhere, not just at the beginning of the method. I often need to var a variable with a value that is dependant upon another condition (such as a conditional based on an argument being passed in). Because I have to var before any other cfml statements, I first have to var the variable and set it to empty (var=""), then do the conditional later. I'd like to see VAR implemented like in JavaScript. It would be great to var a loop variable inline, as opposed to at the top of the page for example
  40. Make the installer for deploying multiple instances of CFMX easier
  41. Make it possible to deploy a "clone" of an existing instance of a CFMX deployment right from within the CF Admin of that instance. Similar to your archive and deploy, but have the deploy actually create the new instance and then clone the original
  42. Make it easier to tie a different jvm classpath to each instance of CFMX when using multiple instances.