Re: broker start up in Tomcat

2007-07-27 Thread suchitha koneru
Thank you  Len for the suggested approach . The web apps should be
abstracted from the procedure of starting the broker, otherwise I'll end up
adding a servlet context listener for every new web app added to our
application. If possible, Iam looking for a way , in which Tomcat would
start the broker without any involvement from web applications.


On 7/26/07, Len Popp [EMAIL PROTECTED] wrote:

 Write a function in your shared lib that checks if Active MQ has been
 started yet, and starts it if not. Then, in each webapp add a
 ServletContextListener with a contextInitialized method that calls the
 aforementioned function. Thus, Active MQ will be initialized when the
 first webapp starts up, whichever it is.
 --
 Len

 On 7/26/07, suchitha koneru [EMAIL PROTECTED] wrote:
  Hello Tomcat Users,
   I am using Tomcat server 5.5.20 along with Java
 1.6,
  and Active MQ 4.1.1.  There are two web applications A and B which
  communicate via the active mq broker. Our application has a requirement
 of
  starting the broker before any of the web apps. Where should I be
 placing
  the code which starts the broker.  I can create a jar file out of the
 code
  and dependent libraries and place it in common/lib. How will I
 communicate
  to Tomcat server that the broker has to be started during the
 server  start
  up  process, before any of the web apps ? Any pointers  in this regard ?
 
  thank you ,
  Suchitha.
 

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: broker start up in Tomcat

2007-07-27 Thread Johnny Kewl
I dont know ActiveMQ but I think you will have to allow any WebApp that 
needs it, to start it, if its not already running I think you have 2 
options, create a custom JNDI object or create a singleton start up object 
in common/lib, here is an article 
http://www.javacoffeebreak.com/articles/designpatterns/index.html


Just remember that the lib is now shared and I imagine you call into this 
broker to send messages, if so remember to make it thread safe, it possibly 
is already.


I am curious about what you using it for... I have still to find application 
for JMS in the TC environment, because sending a message to a servlet from 
an embedded http client has always served me well... its on port 80, so no 
firewall problems etc. I guess its because you have message beans in an 
application server somewhere just wondering.


- Original Message - 
From: suchitha koneru [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Friday, July 27, 2007 12:48 AM
Subject: broker start up in Tomcat



Hello Tomcat Users,
I am using Tomcat server 5.5.20 along with Java 
1.6,

and Active MQ 4.1.1.  There are two web applications A and B which
communicate via the active mq broker. Our application has a requirement of
starting the broker before any of the web apps. Where should I be placing
the code which starts the broker.  I can create a jar file out of the code
and dependent libraries and place it in common/lib. How will I communicate
to Tomcat server that the broker has to be started during the server 
start

up  process, before any of the web apps ? Any pointers  in this regard ?

thank you ,
Suchitha.




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: broker start up in Tomcat

2007-07-27 Thread suchitha koneru
Thank you so much Johnny for the idea. We have two web apps A and B namely.
A is the front end of our application and B is the back end. Our application
is web based, so we have a lot of https requests coming from the browser. We
could have used a servlet for inter web app communication  , but a servlet
is visible to teh outside world. Our Messaging bus implemented using active
mq is confined to the JVM and is not accessible to the out side world. The
Web app A and Web app B have to keep each other updated and in sycn with
respect to the mutual  changes .They do it via the JMS Messaging Bus
implemented using active MQ.

On 7/26/07, Johnny Kewl [EMAIL PROTECTED] wrote:

 I dont know ActiveMQ but I think you will have to allow any WebApp that
 needs it, to start it, if its not already running I think you have 2
 options, create a custom JNDI object or create a singleton start up object
 in common/lib, here is an article
 http://www.javacoffeebreak.com/articles/designpatterns/index.html

 Just remember that the lib is now shared and I imagine you call into this
 broker to send messages, if so remember to make it thread safe, it
 possibly
 is already.

 I am curious about what you using it for... I have still to find
 application
 for JMS in the TC environment, because sending a message to a servlet from
 an embedded http client has always served me well... its on port 80, so no
 firewall problems etc. I guess its because you have message beans in an
 application server somewhere just wondering.

 - Original Message -
 From: suchitha koneru [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 Sent: Friday, July 27, 2007 12:48 AM
 Subject: broker start up in Tomcat


  Hello Tomcat Users,
  I am using Tomcat server 5.5.20 along with Java
  1.6,
  and Active MQ 4.1.1.  There are two web applications A and B which
  communicate via the active mq broker. Our application has a requirement
 of
  starting the broker before any of the web apps. Where should I be
 placing
  the code which starts the broker.  I can create a jar file out of the
 code
  and dependent libraries and place it in common/lib. How will I
 communicate
  to Tomcat server that the broker has to be started during the server
  start
  up  process, before any of the web apps ? Any pointers  in this regard ?
 
  thank you ,
  Suchitha.
 


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: broker start up in Tomcat

2007-07-26 Thread Len Popp
Write a function in your shared lib that checks if Active MQ has been
started yet, and starts it if not. Then, in each webapp add a
ServletContextListener with a contextInitialized method that calls the
aforementioned function. Thus, Active MQ will be initialized when the
first webapp starts up, whichever it is.
-- 
Len

On 7/26/07, suchitha koneru [EMAIL PROTECTED] wrote:
 Hello Tomcat Users,
  I am using Tomcat server 5.5.20 along with Java 1.6,
 and Active MQ 4.1.1.  There are two web applications A and B which
 communicate via the active mq broker. Our application has a requirement of
 starting the broker before any of the web apps. Where should I be placing
 the code which starts the broker.  I can create a jar file out of the code
 and dependent libraries and place it in common/lib. How will I communicate
 to Tomcat server that the broker has to be started during the server  start
 up  process, before any of the web apps ? Any pointers  in this regard ?

 thank you ,
 Suchitha.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]