: the session of the thread that sends or receives the message; // destination: the Message destination; to which the message is sent. destination destination; // messageproducer: messageproducer; // textmessage; // construct the connectionfactory instance object. activemq is used here. Jar connectionfactory = new activemqconnectionfactory (activemqconnection. default_user, activemqconnection. default_password, "TCP: // localhost: 61616"); try {// con
one forced you, orders are in the ACTIVEMQ waiting in line, they will not be irritable.This scenario is ideal for a cache queue, which is called Message Queuing, and many products can implement this feature, by the way, to answer the next potential problem: he is much faster than a database operation.This article starts from the Foundation to study together, this paper system operating environment: WINDOW7 32 bit2. Download ACTIVEMQOfficial website:
ActiveMQ notes (2): HA solution based on ZooKeeper, activemqzookeeper
Activemq official website provides three master/slave HA solution, see: http://activemq.apache.org/masterslave.html, based on shared file directory, db, zookeeper.
The following shows how to build an activemq Cluster Based on zookeeper on the local machine:
1. Install
Scenarios:In the project, some operations without immediate return and time-consuming are extracted and processed asynchronously, which greatly saves the request response time of the server and improves the throughput of the system.
Second, JMSReference article: Https://baike.baidu.com/item/JMS/2836691?fr=aladdin2.1 About JMSJMS, the Java Message Service Application interface, is an API for message-oriented middleware (MOM) in the Java platform for sending messages between two applications, or
WCF host Management Console. WindowsService. WinFrom. WebAPI host management console and windows service, and wcf host Management Console
Create the wcf Class Library first. Some Trial code will be generated by default:
Public class Service1
{
Public string GetData (int value){Return string. Format ("You entered: {0}", value );}
}
The code for the boarding
1.ActiveMQ is an open source JMS implementation.Can not affect the user execution results and relatively time-consuming tasks (such as sending an email notification to the administrator) asynchronously thrown to the JMS server, and as soon as possible to return the screen to the user, and the server can be multithreaded queued to respond to high concurrent requests. Can achieve the highest decoupling in the Java world. The client and the server do not
*/ @RequestMapping("/send") Public void Send() {//Specify the destination and content of the message sent This.jmsmessagingtemplate.Convertandsend( This.Queue,"New message sent!" "); }}In the preceding code, the Send () method specifies that the message is sent to the queue object by using the Jmsmessagetemplate convertandsend () method, which sends the message "the newly sent messages!" ”。4. Create a message listenerCreate a client controller class Customercontroller and write a
same queue of the remote broker cannot be seen in the broker used for forwarding (the Browse message list is empty, and the queuesize is 0 ).Example
Download activemq 5.7 with the example of static network connector.
That is, the profile activemq-static-network-broker1.xml and activemq-static-network-broker2.xml.
They respectively use the TCP: // localhost: 6161
Chcp
Show activity Console
CodeNumber of pages, or change the active console code page of the console. If no parameter is available, the chcp displays the number of code pages in the active console.
SyntaxChcp [NNN]
Parameters
Specifies the code page. The following table lists all supported code pages and their
, use the command tar zxvf Activemq-x.x.x.tar.gz unpacked to a directory can be used. ACTIVEMQ may require the following port 1099 (JMX), 61616 (default transportconnector)Windows View listening ports:netstat -an|find "61616"Linux systems:netstat -an|grep61616运行后可以打开web控制台:Http://localhost:8161/adminIf you can open the console page, the installation is successful
Simply put, it implements tracking and notification of various operations on the activemq broker.
With this function, you can know the broker in real time.
Creates or destroys a connection,
Added or deleted survivors or consumers,
Added or deleted topics or queues,
Messages are sent and received,
When are there slow consumers,
When will there be a producer?
When And when messages are discarded
When is the broker added to the cluster (Master
Shadowwind (Lily has died) 17:22:25 on
VC/MFC/
Basic ClassHow to call the console program: 1. Hide the console window; 2. Get the exit status of the console Program
I use system and _ spawnlp. The returned value is exit code, but the window cannot be hidden.Windows can be hidden with winexec (command, sw_hide), but no exit code is available.
Thank you for your a
Recently wrote a network module, with the command line Windows comes out debugging information, debugging information a bit more, monochrome slightly monotonous, so took a little time to do the following small modules.The code is very small, the use of the method is extremely simple , I will not repeat, the following examples. Less time, less talk.Have any bug, or have any need to improve, remember to contact me at any time ~ ~PaletteExample code:1#include 2 3#include"color_term.h"4 5 intMain ()
Console. debug (): the console prints the output only in the browser that supports the console.
Console. debug (): the console prints the output only in the browser that supports the console.
Var util = {};/*** tool clas
Springboot and ActiveMQ integration, springbootactivemqPreface
Many projects are not completed by a system. Instead, many systems work together to complete functions. Then, it is impossible for systems to be completely independent of each other?
For example, the management system used by the school includes the student system, the asset system, and the dormitory system. after the end of the semester, do you need to archive the completed period. if the
Xingbo.xu-queue is a server queue that must be configured in the ACTIVEMQ console theDestination = Session.createqueue ("Jyqueue"); + //get the message generator "sender" -Producer =session.createproducer (destination); $ //set not persisted, learn here, actually according to the project decision $ Producer.setdeliverymode (deliverymode.non_persistent); - //constructs a
Source: http://iffiffj.iteye.com/blog/1404148Save the following code as a bat file and run it on the JBoss node.@echo Offset HOME=%~dp0set Jmx_console=%home%\deploy\jmx-Console.warset Jbossws_context=%home%\deploy\jbossws.sar\jbossws-Context.warset Web_console=%home%\deploy\management\console-mgr.sar\web-Console.warset Root_console=%home%\deploy\jboss-Web.deployer\root.warset Root_context=%home%\deploy\jboss-Web.deployer\context.xmlecho%home% for/d%%i
1. Download tar.gz Compression Pack http://mirrors.cnnic.cn/apache/activemq/5.11.1/apache-activemq-5.11.1-bin.tar.gz2. Upload to 235, unzip TAR-XVF apache-activemq-5.11.1-bin.tar.gz3. Modify the permissions of the bin directory chmod 755 bin;4. Start Activemq./activemq start
Transferred from: http://marshal.easymorse.com/archives/1414ACTIVEMQ can be deployed and executed separately, such as the installation and execution methods mentioned in the simplest applications like ACTIVEMQ. But sometimes it needs to be deployed as a Web application in a servlet container, which facilitates collaboration with other Web applications.There is a document on the official document that addresses this requirement:
Http://activem
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.