Webseiten-Werkzeuge


dieser Artikel ist uralt

ja wirklich

ActiveMQ unter Debian Linux

Files

/opt/activemq/apache-activemq-5.3-SNAPSHOT
/opt/activemq/default -> /opt/activemq/apache-activemq-5.3-SNAPSHOT
  • Chown directories

Initskript

#!/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
 
. /lib/lsb/init-functions
 
ACTIVEMQ_USER=activemq
ACTIVEMQ_BIN_HOME=/opt/activemq/default/bin/linux-x86-64
test -d ${ACTIVEMQ_BIN_HOME} \
       || (echo ACTIVEMQ_BIN_HOME existiert nicht >&2; exit 1)
 
 
start() {
       start-stop-daemon \
                 --start \
                 --chuid "${ACTIVEMQ_USER}" \
                 --chdir "${ACTIVEMQ_BIN_HOME}" \
                 --exec ./activemq --  start
       log_end_msg $?
}
stop() {
       start-stop-daemon \
                 --start \
                 --chuid "${ACTIVEMQ_USER}" \
                 --chdir "${ACTIVEMQ_BIN_HOME}" \
                 --exec ./activemq --  stop
       log_end_msg $?
}
restart() {
       stop
       start
}
 
case "$1" in
 start)
       start
       ;;
 stop) 
       stop
       ;;
 restart|reload)
       restart
       ;;
 *)
       echo "Usage: $0 {start|stop|restart}"
       false
esac
 
exit $?

Aktivieren:

$ update-rc.d activemq defaults

Einstellungen

  • Transports, stomp aktivieren (activemq.xml):
    <destinations>
      <queue physicalName="im.icq" />
      <topic physicalName="systemstatus" />
    </destinations>
  ...
    <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
    <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614"/>
  ...
              <plugins>
                <!-- Configure authentication; Username, passwords and groups -->
                <simpleAuthenticationPlugin>
                    <users>
                        <authenticationUser username="admin" password="XXX" groups="..,.."/>
                        <authenticationUser username="XXX" password="XXX" groups="..."/>
                    </users>
                </simpleAuthenticationPlugin>
 
              <!--  Lets configure a destination based authorization mechanism -->
              <authorizationPlugin>
                <map>
                  <authorizationMap>
                    <authorizationEntries>
                      ...
                      <authorizationEntry topic="ActiveMQ.Advisory.>" read="users,daemons" write="users,daemons" admin="users,daemons"/>
                    </authorizationEntries>
                  </authorizationMap>
                </map>
              </authorizationPlugin>
            </plugins>
  ...
</broker>

Clients

Python (stomp)

Shell (stomp)

SVN/HTTP Checkout: http://xapek.org/svn/common/mq/bash/

artikel/activemq.txt · Zuletzt geändert: 2014/04/30 20:32 von yvesf