activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suchitha Koneru \(sukoneru\)" <sukon...@cisco.com>
Subject RE: Trying to get started: how do I configure Tomcat to run ActiveMQ?
Date Mon, 09 Jul 2007 19:37:05 GMT
There is this link for vm transport as well 
http://activemq.apache.org/vm-transport-reference.html 

-----Original Message-----
From: Suchitha Koneru (sukoneru) 
Sent: Monday, July 09, 2007 12:31 PM
To: users@activemq.apache.org
Subject: RE: Trying to get started: how do I configure Tomcat to run
ActiveMQ?

The approach which I used for starting active mq broker via Tomcat
server is  as follows 

1) Include the connection factory for starting the active mq broker in
Tomcat/conf/context.xml as follows

      <Resource
        	name="jms/ConnectionFactory"
        	auth="Container"
        	type="org.apache.activemq.ActiveMQConnectionFactory"
        	description="JMS Connection Factory"
       	 	factory="org.apache.activemq.jndi.JNDIReferenceFactory"
 
brokerURL="vm://localhost?brokerConfig=xbean:activemq.xml"
			 
       />			
Make sure that activemq.xml should be present in the classpath of
Tomcat.  You can also specify brokerConfig as
brokerConfig=xbean:file:./activemq.xml.  


3)The active mq jars should be placed under (Tomcat/common/lib) of
Tomcat 


4)The Queues/Topics can be defined under  Tomcat/conf/context.xml.
      <Resource name="jms/TopicOne" 
    		  auth="Container" 
    		  type="org.apache.activemq.command.ActiveMQTopic" 
    		  description="the topic against which the client back
end will publish and server back end would subscribe"
 
factory="org.apache.activemq.jndi.JNDIReferenceFactory" 
  	          physicalName="FOO1.BAR"/>        
        
        
      <Resource name="jms/TopicTwo" 
    		  auth="Container" 
    		  type="org.apache.activemq.command.ActiveMQTopic" 
    		  description="the topic against which the server back
end will publish and client back end would subscribe"
 
factory="org.apache.activemq.jndi.JNDIReferenceFactory" 
  	          physicalName="FOO2.BAR"/>      




5) The code for connecting to the broker is as follows 
     	
	Ictx = new javax.naming.InitialContext();
	envContext = (Context) Ictx.lookup("java:comp/env");
		TopicConnectionFactory  sampleconnectionFactory =
	
(TopicConnectionFactoryenvContext.lookup("jms/ConnectionFactory");




The broker is created and started when the first attempt to connect to
the broker is made.

Thanks,
Suchitha.

-----Original Message-----
From: Sandeep Chayapathi [mailto:sandeep@wssource.com] 
Sent: Monday, July 09, 2007 8:51 AM
To: users@activemq.apache.org
Subject: Re: Trying to get started: how do I configure Tomcat to run
ActiveMQ?


Hi,
 Im not sure if activemq can be started via tomcat, however I know you
can publish/subscribe to activemq topics/queue over web interface. You
need to copy/link few of the jar files in activemq/lib and
activemq/lib/optional to tomcat's lib folder.

 Then in tomcat's conf/web.xml:

1. add context params params for: org.apache.activemq.brokerURL and turn
on 
    org.apache.activemq.embeddedBroker

2. map REST servlets, mainly the : org.apache.activemq.web.AjaxServlet
and 
    org.apache.activemq.web.MessageServlet

3. map url to the above servlets, by practise, you can use /amq and
/message

for further help, checkout the
https://svn.apache.org/repos/asf/activemq/trunk/activemq-web-demo/
activemq-web-demo 

- Sandeep
 

Henk van Voorthuijsen wrote:
> 
> After downloading ActiveMQ 4.1.1, I managed to sucessfully run it as 
> stand-alone.
> As a following step, I tried to get Tomcat to start the same process -

> and that's where I get lost!
> 
> I have tried adding a ConnectionFactory and Queue to the 
> <GlobalNamingResources> element, and they do show up on the resource 
> page of the Tomcat manager, but so far I can see no processes being
started.
> 
> A step-by-step description of how to do this would be much
appreciated.
> 
> Henk van Voorthuijsen
> 
> PS. My configuration:
> Windows XP
> Tomcat 5.5.17
> ActiveMQ 4.1.1
> 
> 
> 

--
View this message in context:
http://www.nabble.com/Trying-to-get-started%3A-how-do-I-configure-Tomcat
-to-run-ActiveMQ--tf4050129s2354.html#a11504393
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message