ActiveMQ: Difference between revisions
No edit summary |
No edit summary |
||
Line 35: | Line 35: | ||
rm activemq-cpp-library-3.8.2-src.tar | rm activemq-cpp-library-3.8.2-src.tar | ||
cd activemq-cpp-library-3.8.2 | cd activemq-cpp-library-3.8.2 | ||
./configure --prefix=/usr/local | ./configure --prefix=/usr/local (or ./configure CC=/apps/gcc/8.3.0/bin/gcc CXX=/apps/gcc/8.3.0/bin/g++ --prefix=/usr/local) | ||
make | make | ||
make install | make install |
Revision as of 15:24, 27 March 2019
Install Apache ActiveMQ
Download ActiveMQ tar file (for example apache-activemq-5.14.4-bin.tar.gz) from http://activemq.apache.org to /usr/downloads
Untared the tar-file in the /usr/local/src/ directory.
Go to /usr/local/src/apache-activemq-5.14.4/bin directory, become superuser and start by issuing
./activemq console (interactive mode) ./activemq start (batch mode)
When checking the port with netstat, getting
netstat -an | fgrep 61616 tcp 0 0 :::61616 :::* LISTEN
indicating that ActiveMQ is running.
Configuration files are /usr/local/src/apache-activemq-5.14.4/bin/env and /usr/local/src/apache-activemq-5.14.4/conf/activemq.xml. In env file there is setting
ACTIVEMQ_OPTS_MEMORY="-Xms64M -Xmx4G"
where -Xmx defines maximum heap size, default is 1G, it should be increased if memory allows.
Install C++ API
Download activemq-cpp tar file (for example activemq-cpp-library-3.8.2-src.tar.gz) from http://activemq.apache.org/cms/download.html to /usr/downloads.
cd /usr/local/src cp /usr/downloads/activemq-cpp-library-3.8.2-src.tar.gz . gunzip activemq-cpp-library-3.8.2-src.tar.gz tar xvf activemq-cpp-library-3.8.2-src.tar rm activemq-cpp-library-3.8.2-src.tar cd activemq-cpp-library-3.8.2 ./configure --prefix=/usr/local (or ./configure CC=/apps/gcc/8.3.0/bin/gcc CXX=/apps/gcc/8.3.0/bin/g++ --prefix=/usr/local) make make install
Running C++ example
Go to /usr/local/src/activemq-cpp-library-3.8.2-src. Modify src/examples/main.cpp file setting hostname where ActiveMQ broker is running, line
"failover:(tcp://localhost:61616".
Type 'make', the run it:
./src/examples/example
It will print messages like 'Message #1993 Received: Hello world! from thread 140724062602600' and in the end 'Time to completion = 0.178 seconds.'.
NOTE1: on RHEL5/CentOS5 apr-1.4.8.tar.gz was installed by commands './configure --prefix=/usr/local', 'make', 'make install'
NOTE2: on RHEL5/CentOS5 openssl-1.0.1e.tar.gz was installed by commands './config --prefix=/usr/local', 'make', 'make install'