您的位置:首页 > 其它

ActiveMQ安装及配置

2008-07-01 16:19 351 查看

启动ActiveMQ

TherenowfollowsinstructionsonhowtoruntheActiveMQMessageBroker.

OnWindows:

Fromaconsolewindow,changetotheinstallationdirectoryandrunActiveMQ:

cd[activemq_install_dir]

whereactivemq_install_diristhedirectoryinwhichActiveMQwasinstalled,e.g.,c:/ProgramFiles/ActiveMQ-4.x.
Thentype:

bin/activemq

NOTE:Workingdirectoriesgetcreatedrelativetothecurrentdirectory.Tocreateworkingdirectoriesintheproperplace,ActiveMQmustbelaunchedfromitshome/installationdirectory.

OnUnix:

在SHELL命令行模式下,通过下面命令进入到ActiveMQ安装目录:

cd[activemq_install_dir]

然后输入下面命令启动ActiveMQ:

bin/activemq




bin/activemq>/tmp/smlog2>&1&;

Note:/tmp/smlogmaybechangedtoanotherfilename.

NOTE:Workingdirectoriesgetcreatedrelativetothecurrentdirectory.Tocreateworkingdirectoriesintheproperplace,ActiveMQmustbelaunchedfromitshome/installationdirectory.



Warning
DoNOTclosetheconsoleorshellinwhichActiveMQwasstarted,asthatwillterminateActiveMQ(unlessActiveMQwasstartedwithnohup).

nohupbin/activemq>/tmp/smlog2>&1&

WEB监控ActiveMQ

TherearevariouswaystomonitorActiveMQ.Ifyouareonversion4.2orlaterofActiveMQyoucanthenmonitorActiveMQusingtheWebConsolebypointingyourbrowserat

http://localhost:8161/admin



OryoucanusetheJMXsupporttoviewtherunningstateofActiveMQ.

停止ActiveMQ

不管在WINDOWS还是UNIX下,在ActiveMQ正在运行的控制台或SHELL命令行下输入"CTRL-C"来终止运行

如果ActiveMQ是在后台启动,则可通过以下方法停止:

ps-ef|grepactivemq

kill[PID]

[PID]就是ActiveMQ运行的进程ID.

配置ActiveMQ

TheActiveMQbrokershouldnowrun.YoucanconfigurethebrokerbyspecifyinganXmlConfigurationfileasaparametertotheactivemqcommand.AnalternativeistousetheBrokerConfigurationURItoconfigurethingsonthecommandlineinaconciseformat(thoughtheconfigurationoptionsarenotasextensiveasifyouuseJavaorXMLcode).Youcanalso

AlsoseeConfiguringTransportstoseehowyoucanconfigurethevariousconnection,transportandbrokeroptionsusingtheconnectionURLintheActiveMQConnectionFactory.

SeetheInitialConfigurationfordetailsofwhichjarsyouneedtoaddtoyourclasspathtostartusingActiveMQinyourJavacode

IfyouwanttouseJNDItoconnecttoyourJMSproviderthenpleaseviewtheJNDISupport.IfyouareaSpringuseryoushouldreadaboutSpringSupport

Aftertheinstallation,ActiveMQisrunningwithabasicconfiguration.Fordetailsonconfiguringoptions,pleaseseerefertotheConfigurationsection.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: