You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

Part 1: Gateways to Fun

Here We Are Again!

The new release of ColdFusion has some interesting new Java features that just beg for a return and so here we are again! As with the previous series, I'll take the time to cover the basics of these new features before I dig a bit deeper.

Event Gateways
Undoubtedly one of the coolest new Java features in ColdFusion MX 7 is event gateways - opening up a whole new set of possibilities that were, at best, difficult, and at worst, impossible, with previous versions of ColdFusion. Providing a ColdFusion-friendlier means for working with new network protocols to more mundane things like interacting with operating system services, gateways will allow you to expand your Web applications in directions that were previously inaccessible.

The product team did an amazing job of providing a number of samples that really demonstrate the capabilities of this new feature. Add to that the really excellent Macromedia Developer Center article, some exciting postings in various blogs and some advanced articles waiting in the wings for CFDJ - all in all, there's definitely more than a little material available.

So what's the goal with this series? To provide easy-to-consume walkthroughs and tutorials for doing simple things like working with the gateway pages in the ColdFusion Administrator; and to provide a solid ground about the nuts and bolts of writing gateways.

The Basics
An event gateway is just a Java class that acts like a service to extend the ColdFusion Server. It differs from things like CFX tags in that they are threaded and can provide asynchronous communication with a ColdFusion application.

A template can call a CFX tag but that template will hang around until it is done processing before continuing to the next tag in the template. The expectation is that the CFX will perform some immediate task and return. It's possible to write a multithreaded CFX tag but there is no framework for having those subordinate threads report back once the main body of the CFX has returned control to the calling template. Event gateways solve this problem.

Event Gateway Administrator Pages
More than merely allowing you to configure things, the ColdFusion Administrator's Event Gateway pages can tell you a great deal about this new facility. As I cover the configuration pages I will introduce you to bits of gateway jargon that will be useful later when we start building applications that use gateways (for a complete list of the jargon check the product documentation; Developing ColdFusion MX Applications, Using Event Gateways, Event gateway terms and concepts).

The Event Gateways Settings page (see Figure 1) offers up a few minor, but important options, though in the Developer Edition of the product most of these settings are locked. The first is a check box for enabling gateways, which is checked by default. The second and third settings, processing threads and the size of the event queue respectively, will allow you to fine-tune gateway performance. The Developer Edition has these locked at 10 threads and 25000 events, which is quite generous for basic development.

[Note: Also on this page is a button to start the built-in SMS test server. You can use this sample SMS gateway and client simulator to explore more. I'm not going to cover it in this article as it is already discussed in some detail in the product documentation.

Gateway Types
The Event Gateways Gateway Types page (see Figure 2) provides a way for you to identify gateway classes to the ColdFusion Server, thus creating a type. There are four editable fields and a check box on this page for creating a gateway type and a list of the presently configured gateway types.

The first field, Type Name, is the name you will give the type (this is the gateway type in the jargon). There are no specific requirements, such as matching the name of the Java class or such, only something that is unique and at best meaningful to the purpose of the gateway.

The Description field provides an opportunity to input some textual content for providing more explanatory information about a gateway. The field has a limitation of 550 characters - so try to keep it simple.

The Java Class field is where you enter the name of the gateway's Java class, complete with package. This field is not so frugal as the Type Name or the Description, though if you've a class name in excess of 550 characters you might consider some package reordering and less verbose naming standards. The Java class must indicate a class that is already present in the ColdFusion Server's classpath or else it will fail when you try to add the new gateway type. Since adding jars to the Server's classpath requires a restart you will want to verify this prior to adding new gateway types. New jars can be added in the ColdFusion Class Path field on the Java and JVM page in the Server Settings section of the Administrator.

The Startup Timeout field indicates the number of seconds that the Server will allow during the startup of an event gateway before it kills it; by default this is 30 seconds. This seems a bit excessive since most system operations occur in milliseconds - and even long operations in the thousands of milliseconds fall well below this threshold.

Out of the box the Developer Edition has seven gateway types configured (shown in Figure 2 above). These default gateways provide a number of very useful facilities that satisfy many of the both basic and things-in-vogue services.

Gateway Instances
The Event Gateways Gateway Instances page (see Figure 3) allows you to create instances of a specific gateway type (a gateway instance in the jargon). This page provides three edit fields and two dropdown lists for configuring an instance and a list of the configured gateway instances.

The Gateway ID field allows you to specify a label name for a particular instance. This is the name (or gateway ID in the jargon) that will be used to programmatically reference the event gateway for sending messages. It does not have any specific requirements, though it should be unique and meaningful. The form field displayed in the browser has a limit of 550 characters which ought to be plenty even for host providers that might like to prefix a specific gateway instance name with a domain name or a corporate server prefixing with a department name.

More Stories By Guy Rish

Guy Rish is a ColdFusion and .NET developer at Vente as well as President at Gestaltech. He is an active developer and writer for various languages and technologies, and has contributed work in books on ColdFusion MX, Flash MX, and Dreamweaver MX. He blogs at ccoj.coldfusionjournal.com.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

@ThingsExpo Stories
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
Most people haven’t heard the word, “gamification,” even though they probably, and perhaps unwittingly, participate in it every day. Gamification is “the process of adding games or game-like elements to something (as a task) so as to encourage participation.” Further, gamification is about bringing game mechanics – rules, constructs, processes, and methods – into the real world in an effort to engage people. In his session at @ThingsExpo, Robert Endo, owner and engagement manager of Intrepid D...
Recently, WebRTC has a lot of eyes from market. The use cases of WebRTC are expanding - video chat, online education, online health care etc. Not only for human-to-human communication, but also IoT use cases such as machine to human use cases can be seen recently. One of the typical use-case is remote camera monitoring. With WebRTC, people can have interoperability and flexibility for deploying monitoring service. However, the benefit of WebRTC for IoT is not only its convenience and interopera...
Michael Maximilien, better known as max or Dr. Max, is a computer scientist with IBM. At IBM Research Triangle Park, he was a principal engineer for the worldwide industry point-of-sale standard: JavaPOS. At IBM Research, some highlights include pioneering research on semantic Web services, mashups, and cloud computing, and platform-as-a-service. He joined the IBM Cloud Labs in 2014 and works closely with Pivotal Inc., to help make the Cloud Found the best PaaS.
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...
Business professionals no longer wonder if they'll migrate to the cloud; it's now a matter of when. The cloud environment has proved to be a major force in transitioning to an agile business model that enables quick decisions and fast implementation that solidify customer relationships. And when the cloud is combined with the power of cognitive computing, it drives innovation and transformation that achieves astounding competitive advantage.
Personalization has long been the holy grail of marketing. Simply stated, communicate the most relevant offer to the right person and you will increase sales. To achieve this, you must understand the individual. Consequently, digital marketers developed many ways to gather and leverage customer information to deliver targeted experiences. In his session at @ThingsExpo, Lou Casal, Founder and Principal Consultant at Practicala, discussed how the Internet of Things (IoT) has accelerated our abilit...
In his session at Cloud Expo, Alan Winters, U.S. Head of Business Development at MobiDev, presented a success story of an entrepreneur who has both suffered through and benefited from offshore development across multiple businesses: The smart choice, or how to select the right offshore development partner Warning signs, or how to minimize chances of making the wrong choice Collaboration, or how to establish the most effective work processes Budget control, or how to maximize project result...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the business value. In his session at Cloud Expo, Ed Featherston, a director and senior enterprise architect at Collaborative Consulting, discussed the key considerations around quality, volume, timeliness, and pedigree that must be dealt with in order to properly fuel that engine.
In his keynote at 19th Cloud Expo, Sheng Liang, co-founder and CEO of Rancher Labs, discussed the technological advances and new business opportunities created by the rapid adoption of containers. With the success of Amazon Web Services (AWS) and various open source technologies used to build private clouds, cloud computing has become an essential component of IT strategy. However, users continue to face challenges in implementing clouds, as older technologies evolve and newer ones like Docker c...
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Two weeks ago (November 3-5), I attended the Cloud Expo Silicon Valley as a speaker, where I presented on the security and privacy due diligence requirements for cloud solutions. Cloud security is a topical issue for every CIO, CISO, and technology buyer. Decision-makers are always looking for insights on how to mitigate the security risks of implementing and using cloud solutions. Based on the presentation topics covered at the conference, as well as the general discussions heard between sessio...
To Really Work for Enterprises, MultiCloud Adoption Requires Far Better and Inclusive Cloud Monitoring and Cost Management … But How? Overwhelmingly, even as enterprises have adopted cloud computing and are expanding to multi-cloud computing, IT leaders remain concerned about how to monitor, manage and control costs across hybrid and multi-cloud deployments. It’s clear that traditional IT monitoring and management approaches, designed after all for on-premises data centers, are falling short in ...
Organizations planning enterprise data center consolidation and modernization projects are faced with a challenging, costly reality. Requirements to deploy modern, cloud-native applications simultaneously with traditional client/server applications are almost impossible to achieve with hardware-centric enterprise infrastructure. Compute and network infrastructure are fast moving down a software-defined path, but storage has been a laggard. Until now.
DXWorldEXPO LLC announced today that the upcoming DXWorldEXPO | CloudEXPO New York event will feature 10 companies from Poland to participate at the "Poland Digital Transformation Pavilion" on November 12-13, 2018.
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering CloudEXPO | DXWorldEXPO will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at CloudEXPO. Product announcements during our show provide your company with the most reach through our targeted audienc...
In an era of historic innovation fueled by unprecedented access to data and technology, the low cost and risk of entering new markets has leveled the playing field for business. Today, any ambitious innovator can easily introduce a new application or product that can reinvent business models and transform the client experience. In their Day 2 Keynote at 19th Cloud Expo, Mercer Rowe, IBM Vice President of Strategic Alliances, and Raejeanne Skillern, Intel Vice President of Data Center Group and ...