> Got me thinking that CFML should have the inherent ability to
> send/receive JMS messages -- something like a cfmessage tag.
JMS is inherently asynchronous. CF is (currently) based on synchronous
HTTP request / response pairs. That's why Blackstone is introducing
the event gateway. The event gateway provides a way to handle
asynchronous events like JMS.
It wouldn't make sense for CF to have a cfmessage tag, except perhaps
as a convenience for sending messages to a JMS server (we have a
simple CFC that wraps a simple Java class for doing just that).
Inbound messages have to be received in an asynchronous manner.
Blackstone's event gateway makes this easy:
- if a gateway for the type of protocol you want is not already
provided, write a few lines of Java to interact with it (see my blog
for just how little Java you need)
- configure a gateway based on the Java protocol helper, a CFC and a
configuration file
That's it! The Java code receives events (and can send them to if you
write it that way) and passes them to the CFC (via the gateway). The
CFC processes the event and either returns a result (which the Java
code passes back if appropriate) or calls a gateway helper to send
results back (see my blog notes on the IRC bot I wrote).
Note that a JMS client can use *any* JMS server if it keeps the
connection factory / topic factory information in a properties file.
For example, here is the properties file I use:
# JMS Gateway configuration file:
# $Id: jmsgateway.cfg,v 1.3 2004/07/23 18:19:04 scorfield Exp $
durable=yes
subscriberName=SALESORDER_ADAPTER
topicName=cn=add_salesorder,cn=Topics,cn=MsgHub,ou=EAI,o=Macromedia,c=US
providerURL=http://xxxx.macromedia.com:yyyy
#initialContextFactory=jrun.naming.JRunContextFactory
initialContextFactory=fiorano.jms.runtime.naming.FioranoInitialContextFactory
#topicConnectionFactory=jrun.naming.JRunContextFactory
topicConnectionFactory=cn=primaryTCF,cn=TopicConnectionFactories,cn=MsgHub,ou=EAI,o=Macromedia,c=US
The commented out lines are for the JRun JMS server, the uncommented
lines are for our Fiorano MQ JMS server (a choice that pre-dates the
Allaire acquisition). I use JRun locally for development and
debugging, then deploy to Fiorano MQ.
--
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

