Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CF & ActiveMQ integration?

Anyone tried integrating CF with ActiveMQ? How was the experience? Worth spending time to build a new solution on it? I would like to learn more on how to use it, any resource you can point me to?

update: Can ActiveMQ run under JRun together with ColdFusion? We're using the Standard Edition.

Thanks

like image 785
Henry Avatar asked Jun 28 '11 06:06

Henry


People also ask

What does cf stand for?

Cf. is an abbreviation for the Latin word confer, meaning "compare." Cf. is a signal indicating that the cited source supports a different claim (proposition) than the one just made, that it is worthwhile to compare the two claims and assess the difference.

What does cf mean in science?

in a scientific name means "colour form" but it has a rather different meaning, as Matt Clarke explains. The abbreviation cf. comes from the Latin word conferre, which means “compare to” or “confer.” It's not short for colour form, as some mistakenly believe. The use of cf.

What does cf mean after a name?

cf. An abbreviation meaning “compare.” It is short for the Latin word confer and instructs the reader to compare one thing with another.

What is cf in business?

What is Cash Flow? Cash Flow (CF) is the increase or decrease in the amount of money a business, institution, or individual has. In finance, the term is used to describe the amount of cash (currency) that is generated or consumed in a given time period.


1 Answers

Yes we have used ActiveMQ, in fact we have a project going on at the moment to consume data via a ColdFusion event gateway using ActiveMQ.

Note: we are running on ColdFusion 9.0.1 and we are only consuming messages.

First place to start looking is in your own ColdFusion installation which comes with an ActiveMQ example! Look in {cf_root}\gateway\docs.

So to get setup you need to:

Add the ActiveMQ jar (activemq-all-5.5.0.jar) file (available here) to the CF {cf_root}/lib directory

Move the examples.jar file in {cf_root}\gateway\lib to {cf_root}/lib

Check out the {cf_install}/gateway/docs/ActiveMQ_DeveloperGuide.pdf which will tell you how to create a configuration file. It should look something like this heartbeat.cfg example:

debug=yes
topic=yes
# the line below needs to be changed
providerURL=tcp://xxx.yyy.com:61616
initialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory
connectionFactory=ConnectionFactory

# ActiveMQ requires fake JNDI entries to lookup topic names
contextProperties=topic.heartbeatTopic
topic.heartbeatTopic=com.xxx.yyy.public.heart_beat
destinationName=heartbeatTopic

Next, set up the event gateway:

  • GatewayID: MyTestActiveMQGateway
  • Gateway Type: ActiveMQ (this is an option on CF9)
  • CFC Path: c:\foo\MyCFC.cfc (this is the CFC that will handle data incoming)
  • Configuration File: c:\foo\heartbeat.cfg

Your CFC should look like so:

<cfcomponent output="false">

    <cffunction name="onIncomingMessage" access="public" output="true">
        <cfargument name="data" type="struct" />

        <cflog log="application" text="message arrived!" />


    </cffunction>

</cfcomponent>

Start your event gateway, and lo and behold you should get messages coming in, or some sort of error.

Hope that helps!

like image 111
Ciaran Archer Avatar answered Nov 08 '22 16:11

Ciaran Archer