ACTIVEMQ can be easily integrated with spring, Spring provides a series of interface classes, very useful!such as asynchronous message data, asynchronous send mail, asynchronous message query, etc. The first two ACTIVEMQ jar packages are introduced,The is then spring-activemq for configuration: Create a third-party MQ factory: ConnectionFactoryThen create the
First, introduceSince ActiveMQ5.4, KAHADB has become the default persistent storage method for ACTIVEMQ. Compared to the original AMQ storage, the official claims that KAHADB uses fewer file descriptors and provides a faster storage recovery mechanism.Second, KAHADB storage configurationThe configuration in Conf/activemq.xml is as follows:BrokerBrokername= "Broker" ... > Persistenceadapter> kahadb Directory= "
;
For the use of Apis related to message producers, we will describe the queue and topic respectively.
Under the queue:
Create a queueConnection through the connection factory class provided by ActiveMQ.
QueueConnection calls the start method to truly establish a persistent connection with the message server.
Call the createQueueSession method of queueConnectoin to create a session unit for message-related operations.
Call the createQueue, creat
Before installing, it is necessary to make sure that the JVM environment is already on the machine, and if not, the unable to execute Java command will be prompted during the installation process. The system cannot find the file specifiedFirst step: Download the ACTIVEMQ installation file from the official website and select the version on the Windows platformOfficial website: http://activemq.apache.org/activemq
1, ACTIVEMQ Management background user name, password settingsManage background address http://localhost:8161/admin Default User name Password Admin adminThe port defaults to 8161, and the service uses the server, so we go into the Conf/jetty.xml(1) Modify the port number: class= "Org.apache.activemq.web.WebConsolePort" init-method= "Start" > defaultfor the Web console-- 8161"/> (2) in the change of user name and password (use
One, ACTIVEMQ high availability architectureACTIVEMQ's high availability architecture is based on the Master/slave model. ACTIVEMQ provides a total of four configuration scenarios to configure Ha, where shared nothing master/slave is no longer used after version 5.8, and zookeeper-based replicated is introduced in the ActiveMQ5.9 version LevelDB Store ha scenario.Second, the configuration explanation of Mas
1.ActiveMQ Network Bridging 1.1 ActiveMQtransmission Mode ActiveMQ by means of communication: bridging and forwarding and bidirectional communication 1. bridging forwarding is a Broker that passes messages to another ActiveMQ . 2. Two-way communication is the use of a channel can either receive messages or send messages. The message that is pushed to Broker
RECEIVED a email type message");P.send (tm);} else if (Message.getobjectproperty ("message") = = null) {Messageaction m = new messageaction ();SM SM = new SM ();Sm.setdesttermid (String) message.getobjectproperty ("message"));Sm.setmsgcontent ("Distributed JMS-ACTIVEMQ system testing");M.ADDSM (SM);Message.acknowledge ();} else {SYSTEM.OUT.PRINTLN ("Receive normal messages, do not do any processing!") ");}} catch (JMSException e) {E.printstacktrace (
Recently in the study of OFBiz JMS, played with ACTIVEMQ, ofbiz use Jndi and other JMS to receive and send messages, summed up.Prepareofbiz12.04 versionACTIVEMQ version 5.5Jar PackageIntroducing the package under Base/libActivemq-all-5.5.0.jarGeronimo-j2ee-management_1.1_spec-1.0.1.jarService engine Configurationjndi.properties ConfigurationTry only one topic message mode, if you want to use queue queues, configureTestStart
Activemq runs stably and data throughput is high. If the incoming or outgoing queue is slow, check your ownCodeIs it too slow to process the obtained data.
The performance optimization mentioned in this Article is to list some important points. Please make sure your project has no problems:
1. Use spring jmstemplate
The send and convertandsend modes of jmstemplate use persistent mode even if non_persistent is set. This slows down the inbound que
The reconnection mechanism is one of the specific manifestations of activemq's high availability.
Specifically, you can use the Failover method to connect to one or more brokerurls after the connection is disconnected.
For example: failover :( TCP: // 127.0.0.1: 61616). Multiple URLs can be used here.
By default, if the client and the broker are disconnected directly, the client starts a new thread,
Continuously obtain a URL from the URL parameter to retry the connection.
This mechanism has a pr
1. Basic Concepts
ActiveMQ: It is the most popular and powerful open source message bus that is produced by Apache. is a JMS provider implementation that fully supports the JMS1.1 and Java EE 1.4 specifications.
JMS (Java Messaging Service): is a Java platform for message-oriented middleware (MOM) APIs for sending messages between two applications, or distributed systems, for asynchronous communication. 2. JMS Message mode
1 point to point or queue m
-3.3.6.tar.gz
and then unzip:
TAR-XVF zookeeper-3.3.6.tar.gz-c/opt/amqbroker (path to be unzipped)
Modify Profile:
zoo_sample.cfg Modify file name Zoo.cfg
Modify the Zoo.cfg configuration file content to
ticktime=2000
initlimit=10
synclimit=5
datadir=/opt/amqbroker/zookeeper/data
datalogdir=/opt/ Amqbroker/zookeeper/log
clientport=2181
server.one=192.168.0.100:2888:3888
server.two= 192.168.0.101:2888:3888
server.three=192.168.0.102:2888:3888
Then create the myID file in the/op
In the development process encountered a activemq deadlock problem, painful experience:
scenario: background processes (Appserver1) constantly generate tasks, send to queue front application (appservers) requests, get messages to the queue, and retrieve corresponding data according to the message.
question:
multithreading to the same queue directly call receive, receive messages, the queue will be locked:
The information on the server side dump is as
Activemq-webconsole repair enhanced Edition
Project address: https://github.com/hengyunabc/activemq-webconsole-enhanced
This fix enhanced version is based on activemq5.8.0: http://activemq.apache.org/activemq-580-release.html.
Fixed some display bugs and enhanced the Web Console functionality.
Fixed a problem where connection information could not be
Redis/zookeeper/ActiveMQ installation configuration on Mac, rediszookeeper
Redis, zookeeper, and activemq are required in the framework. Currently, the development environment is set up on Mac, and brew installation is a simple and quick method:
$ brew search zookeeperzookeeper homebrew/php/php53-zookeeper homebrew/php/php55-zookeeperhomebrew/php/php54-zookeeper homebrew/php/php56-zo
Objective
ActiveMQ is the most popular, powerful, open source messaging bus that Apache has produced. ActiveMQ is a JMS provider implementation that fully supports the JMS1.1 and the Java EE 1.4 specification, although the JMS specification has been around for a long time, but JMS still plays a special role in the middle of today's Java EE applications.
First, use the introduction environment prepa
What is activemq
ACTIVEMQ is an open-source, JMS1.1-compliant, message-oriented (MOM) middleware that provides efficient, scalable, stable, and secure enterprise-class messaging for applications.
ACTIVEMQ The role and principle of
The role of ACTIVEMQ is to communicate between systems.Of course, yo
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.