Apache ActiveMQ

概念

Queues

Messages

Consumers

Messages Enqueued | Messages Dequeued

Purge

安装

1
2
3
4
5
cd ~/download
wget activemq-5.15.12-bin.tar.gz
mkdir /usr/local/activemq && cd /usr/local/activemq
tar xzvf ~/download/activemq-5.15.12-bin.tar.gz
mv apache-activemq-5.15.12/ activemq5.15

启动

1
2
cd activemq5.15/bin
./activemq start && tail -f data/activemq.log

停止

1
./activemq stop

配置

编辑 conf\activemq.xml

1
transportConnectors

读写

1
2
3
./activemq producer --message "Mymessage" --messageCount 1
./activemq producer --messageSize 100 --messageCount 1
./activemq producer --payloadUrl http://activemq.apache.org/schema/core/activemq-core.xsd --messageCount 1
1
2
3
./activemq consumer --transacted true
./activemq consumer --ackMode CLIENT_ACKNOWLEDGE
./activemq consumer --durable true --clientId example --destination topic://TEST

常用命令

1
2
activemq status
activemq dstat

参考