Welcome!

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).

Settings
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
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that Conference Guru has been named “Media Sponsor” of the 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. A valuable conference experience generates new contacts, sales leads, potential strategic partners and potential investors; helps gather competitive intelligence and even provides inspiration for new products and services. Conference Guru works with conference organizers to pass great deals to gre...
The Internet of Things will challenge the status quo of how IT and development organizations operate. Or will it? Certainly the fog layer of IoT requires special insights about data ontology, security and transactional integrity. But the developmental challenges are the same: People, Process and Platform. In his session at @ThingsExpo, Craig Sproule, CEO of Metavine, demonstrated how to move beyond today's coding paradigm and shared the must-have mindsets for removing complexity from the develop...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
"Evatronix provides design services to companies that need to integrate the IoT technology in their products but they don't necessarily have the expertise, knowledge and design team to do so," explained Adam Morawiec, VP of Business Development at Evatronix, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
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 ...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
"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.
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, 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.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, 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.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
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 ...