ActiveMQ

Apache ActiveMQ ™ is the most popular and powerful open source messaging and Integration Patterns server.

Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4. Apache ActiveMQ is released under the Apache 2.0 License

cd /usr/share/php
wget http://apache.techartifact.com/mirror/activemq/apache-activemq/5.7.0/apache-activemq-5.7.0-bin.tar.gz
tar xvzf apache-activemq-5.7.0-bin.tar.gz
mv apache-activemq-5.7.0 activemq
vi /etc/init.d/activemqstart.sh
and add following lines
—————————————————–
#!/bin/bash
export JAVA_HOME=/usr
/usr/share/php/activemq/bin/activemq start &
——————————————————-
vi /etc/init.d/activemqstop.sh
and add following lines
——————————————————-
#!/bin/bash
export JAVA_HOME=/usr
/usr/share/php/activemq/bin/activemq stop
———————————————————–
vi /etc/init.d/activemq
and add following lines
————————————————————
#!/bin/bash
#
# activemq       Starts ActiveMQ.
#
# chkconfig: 345 88 12
# description: ActiveMQ is a JMS Messaging Queue Server.
### BEGIN INIT INFO
# Provides: $activemq
### END INIT INFO

# Source function library.
. /etc/init.d/functions

[ -f /etc/init.d/activemqstart.sh ] || exit 0
[ -f /etc/init.d/activemqstop.sh ] || exit 0

RETVAL=0

umask 077

start() {
echo -n $”Starting ActiveMQ: ”
daemon /etc/init.d/activemqstart.sh
echo
return $RETVAL
}
stop() {
echo -n $”Shutting down ActiveMQ: ”
daemon /etc/init.d/activemqstop.sh
echo
return $RETVAL
}
restart() {
stop
start
}
case “$1″ in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $”Usage: $0 {start|stop|restart}”
exit 1
esac

exit $?
————————————————————————–
chmod +x /etc/init.d/activemqstart.sh
chmod +x /etc/init.d/activemqstop.sh
chmod +x /etc/init.d/activemq
/sbin/chkconfig –add activemq
/sbin/chkconfig activemq on
service activemq start

vi activemq/conf/activemq.xml
and add change following lines Set createConnector = true
———————————————————————
<managementContext>
<managementContext createConnector=”true”/>
</managementContext>
———————————————————————
also change transportConnectors and use stomp instead of openwire

<transportConnectors>
<transportConnector name=”stomp” uri=”stomp://localhost:61613″/>
</transportConnectors>

Install php stomp client using
pecl install stomp-beta
add “extension=stomp.so” to php.ini
and restart httpd

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>