Activemq installation and cluster configuration
1. Create a folder activemq/server
Mkdir server
2. Authorization
Chmod 777 server
3. Download The activeMQ installation package and copy it to the/activemq/server Directory.
Apache-activemq-5.9.0-bin.tar.gz ,:
Http://activemq
, account password and account role information are as follows:
# defines users that can access the Web (console, demo, etc.)
# Username:password [, rolename ...]
Admin:admin, admin
user:user, user
3, log configuration:
[Hadoop@fedora1 bin]$ VI. /conf/log4j.properties
The ACTIVEMQ log file storage path is as follows:
Log4j.appender.logfile.file=${activemq.base}/data/activemq.log ...
log4j.appender.logfile
ActiveMQ as a Foregroud process:
> CD activemq-5.13.2/bin
>/ACTIVEMQ Console
b) Run ActiveMQ as a daemon process:
> CD [activemq_install_dir]/bin
>/activemq start
Verify that the installation is successful
After successful sta
ActiveMq usage and activemq usage
I. Introduction to activeMq
ActiveMQ is an open-source middleware that implements the JMS1.1 specification and is oriented to message (MOM, provides efficient, scalable, stable, and secure enterprise-level message communication for applications.
Ii.
Several cluster configurations of ActiveMQ and several clusters of activemq
ActiveMQ is a powerful Messaging Server that supports many development languages, such as Java, C, C ++, and C. Enterprise-level message servers have high requirements on server stability and speed, while ActiveMQ's distributed cluster can meet this requirement. The following describes se
; CONNECTION:JMS client-to-JMS Provider connection Connection Connection = null; Session: A thread that sends or receives a message session session; Destination: The destination of the message, to whom the message is sent. Destination Destination; MessageProducer: Message sender MessageProducer producer; TextMessage message; Constructs the ConnectionFactory instance object, where Activemq is implemented with t
) consumer.receive (100000); if(NULL!=message) {System.out.println ("Receive Message" +Message.gettext ()); } Else { Break; } } } Catch(Exception e) {e.printstacktrace (); } finally { Try { if(NULL!=connection) Connection.close (); } Catch(Throwable ignore) {} }}}4. Precautions
Finally, the receiver and the sender are tested on different machines.
The jar referenced by the project is finally found in Lib under
A Brief Introduction to activeMQ and a brief introduction to activeMQ1. What is activeMQ?ActiveMQ is the most popular and powerful open-source message bus produced by Apache. ActiveMQ is a JMS Provider that fully supports the JMS1.1 and J2EE 1.4 specifications. Although it has been a long time since the JMS specificati
1. Create a new folder Activemq/servermkdir Server2. Authorizationchmod 777 Server3. Download the ACTIVEMQ installation package and copy it to the/activemq/server directoryApache-activemq-5.9.0-bin.tar.gz,:Http://activemq.apache.org/download.html4. Unzip the file to the running directory/
(ConnectionContext context,ConnectionInfo info) throws Exception {Auth (Info.getusername (), Info.getpassword ());Super.addconnection (context, info);}private void auth (String username,string password){
In order to demonstrate the convenience of writing the user password to verify, the actual implementation of the DB verificationif (!) UserName1 ". Equals (userName) | | !" Password1 ". Equals (password)){throw new SecurityException ("Invalid userName or password!");}}
}
4. Export jar packages
Because the project is useful activemq, so record the learning process, first look at JMS.
The JMS (JAVA message Service,java messaging) API is a standard or specification of a messaging service that allows application components to create, send, receive, and read messages based on the Java EE platform. It makes distributed communication less coupled, and messaging services more reliable and asynchronous.
Message model
0point-to-point (Peer-to-peer)
, but cannot receive messages generated before the subscription, similar to a newspaper subscription. . 3.
Persistence : Activemq supports persistence and saves received messages to the database. Even if activemq is restarted, messages that have not been distributed can still be sent. 4.
Asynchronous : The biggest feature of activemq is Asynchronization, which
Activemq is an open-source JMS server that implements the JMS 1.1 Standard. hermesjms is an open-source GUI tool that can connect to many kinds of JMS servers.
However, the configuration methods provided on hermesjms's official website are not detailed, which often puts users in trouble for the first time. This document provides detailed operation steps and a video clip.
1. Install activemq
1. Download act
. Automatically mount the configuration file/etc/fstab
In this way, the master-slave configuration is complete.
In the code, modify brokerurl: failover: // (TCP: // 192.168.102.90: 61616, TCP: // 192.168.102.91: 61616) and enable the reconnection mechanism.
In this way, when activemq of 90 is killed, the system automatically connects to 91. If you want to connect to the 90 s after the 90 s, kill activemq
ActiveMQ-cpp client abnormal application exit problem, activemq Client
The author uses ActiveMQ as the server for message distribution in the system. The Java Web program reads the database real-time records as the Producer, and the receiving end is the client program developed by C ++ Builder. It is resident in the lower right corner of the client, the pop-up wi
startedThe ACTIVEMQ defaults to 61616 ports for the JMS service, using 8161 ports to provide the management console service, and executes the following command to verify that the ACTIVEMQ service has been successfully started.Open port: Nc-lp 61616 See if Port 61616 is open: Netstat-an | grep 61616Check whether it has started:Direct access to
Activemq appears javax.jms.JMSException:Software caused connection Abort:recv failed problem solvinghave been unable to find the reason, the original is in the local network instability, IP jitter connection error, this problem occurs locally is normalWhen putting the program on the service everything is OK ...ACTIVEMQ log appears warning WARN | Transport Connection to:tcp://218.17.179.250:57093 failed:java
1. The camel framework supports a large number of enterprise integration models, which can greatly simplify the large number of services and complex message flows between integrated components. The spring framework focuses more on simplicity and supports only basic best practices.2. The core architecture of the spring message is jmstemplate, which isolates the tedious operations like opening, closing sessions and producer, so application developers simply need to focus on the actual business log
First, Pom.xml and mq.propertiesSpring provides support for JMS and needs to add spring-supported JMS packages, as follows:Add the ACTIVEMQ pool package as follows:Add the Xbean label configuration as follows:Mq.properties:activemq.brokerurl=tcp://192.168.91.8:61616activemq.username=liuyactivemq.password= 123456activemq.maxconnections=100activemq.destination.name=spring-queueactivemq.destinationtopic.name= Spring-topicSecond, mq.xml ConfigurationThird
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.