The program I'm writing uses ActiveMQ to send messages between to
applications.  I'd like one of the applications to start the ActiveMQ server
as a separate process when that application is run.  The code for starting
the ActiveMQ server looks something like this...

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
        //START ACTIVEMQ
        Process ^procActiveMQ = gcnew Process();
        procActiveMQ->StartInfo->FileName = "tools\\activemq\\start_broker.bat";
        procActiveMQ->Start();

        Sleep(15000)  //<----I don't like this approach
        //START OTHER PROCESSES...
}

Do you see that ugly call to Sleep()?  Basically I'm giving ActiveMQ enough
time, on any machine, to get started before I begin creating other processes
that rely on ActiveMQ being up and running.

My question, how can I be notified when ActiveMQ is up and running instead
of just sleeping long enough to guarantee it's ready?  Thanks in advance for
all your help!

Beeeph
-- 
View this message in context: 
http://www.nabble.com/How-can-I-tell-when-ActiveMQ-has-started--tp15993493s2354p15993493.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to