JMS-based Active MQ message storage, jmsmqI. Message Storage Methods
ActiveMQ supports persistent messages and non-persistent messages in JMS specifications.
Persistent messages are usually used to ensure that messages are consumed by consumers regardless of whether the consumers are online or not. After the message is confirmed to be consumed, it will be deleted from the storage.
Non-persistent messages
Java Message Service (JMS) for J2EEReliable message transmission on the platform is standardized. Recently released IBM WebSphere Enterprise Service Bus (ESB)The product provides some important functions that are at the core of any Service-Oriented Architecture (SOA) environment. This series has three articles describing how to integrate JMS andWebSphere ESB is used in combination to form a powerful and rel
message. When you get rid of the message receiving bean deployed in JBoss and then send the message at this time the message is in the queue and once you redeploy he will immediately receive the message just sent so it has no time dependency, pub/sub models can have multiple consumers in this model if we define multiple beans that receive messages when we send a message to the client, two beans will receive the message, so he has multiple consumers b
. The advantage is the strong type, the compile time can check the error, the disadvantage is only based on the Java language, the client and the server tightly coupled.JMS (Java Messaging Service)JMS is a Java messaging service that allows asynchronous message transmission between JMS clients through the JMS service. JMS
. The advantage is the strong type, the compile time can check the error, the disadvantage is only based on the Java language, the client and the server tightly coupled.JMS (Java Messaging Service)JMS is a Java messaging service that allows asynchronous message transmission between JMS clients through the JMS service. JMS
Configuring JMS in the Tomcat serverThe project was originally using WebLogic's JMS service and spring's jmstemplate, so the configuration could not modify the code of the message operation in the projectFirst, download activemq Decompression After the start, access to http://localhost:8161/adminDefault account password admin:admin, click queue, create a new
(Exception e) {e.printstacktrace ();
}finally{try{//close sessions and connection if (session!= null) {session.close ();
} if (connection!= null) {connection.close ();
}}catch (Exception e) {e.printstacktrace (); }}}
To start the test:
Start Activemq and create a queue named Test_queue in the admin page (http://localhost:8161/admin):
Run the program step-by-step when calling:
Producer.send (message);
You can see ACTIVE
Running environment:
Weblogic 92, jdk150
Through the JMX service of weblogic, we can directly obtain mbeans to monitor the JMS server, instead of opening the weblogic online console for manual monitoring every time, which can be completely automated.
The source code is as follows:
Import java. io. IOException;
Briefly introduce this code,
To capture mbeans of JMX, initialize the MBean object first,JmsService = new ObjectName (
You can check the N
The problems and solutions of the single machine affairs of Taobao's mass storage
http://blog.csdn.net/jiao_fuyou/article/details/15499261
This article is quite good. Core keywords: idempotent.
Message Queue Activemq:redeliver, how to do the retry mechanism does not result in a piece of information being executed multiple times. Http://stackoverflow.com/questions/4934386/avoiding-duplicated-messages-on-jms
This article mainly from two aspects to tell:1. Why Use MDB2. Design principles for using MDBLet's take a look at how the messages are communicated.One component of the application sends a JMS message for the specified message purpose, and another component of the application reads the message from the message destination and resolves the contents of the message. This enables communication between the two components.1. The party sending the message, c
message destination and consumer message source. //In PTP mode, destination refers to the queue//In the Publish subscription model, destination refers to the topicDestination Destination = Session.createqueue ("queue1"); //5. Use session to create a message object producer or consumerMessageProducer MessageProducer =session.createproducer (destination); //6. If yes, the producer, using the MessageProducer Setdelivermode method setting, the persistenc
The company's technology platform in the docking of IBM MQ message middleware with a broker, messages sent to MQ have more message header information:RHF2, resulting in the reception of the message is not working properly. Record how this problem is handled here.A parameter, targetclient, is provided in IBM MQ that can be used to control whether the message header is enabled in a JMS message. When using JMS
, and the broker goes down before the broker sends the message to Subscriber, and if the broker restarts after a durable transfer, The message is read from disk and passed to subscriber, and if non-persistent transmission is used, the message is lost.For official documentation of transfer modes, refer toThe difference between message durability and message persistence: I saw it in "ActiveMQ in action" and understood the following:②message PersistenceIndependentThis shows: 1) Message persistence
Use Apache Flume to read the JMS Message Queuing message and write the message to the Hdfs,flume agent configuration as follows:Flume-agent.conf#name the components in this agentagenthdfs.sources = Jms_sourceAgenthdfs.sinks = Hdfs_sinkAgenthdfs.channels = Mem_channel# Describe/configure The sourceAgentHdfs.sources.jms_source.type = JMS# Bind to all interfacesAgentHdfs.sources.jms_source.initialContextFactor
Array_push () can implement the PHP language stack function.
array_push()函数的使用心得1.第一个参数必须是数组。2.所有添加的数组均为索引,即数组下标。3.$num为压入后$stack所含数组元素的个数。4.使用数组的直接赋值也可以实现数组的进栈功能,例如$array$key。$num = array_push($stack"C#""Ruby"array('jsp''Asp'),array('jsp''Asp'));
Array_pop () can implement the queue function of the PHP language.
arrayarrayarrayNULL。 此外如果被调用不是一个数则会产生一个 Warning。
$stack = array("orange", "banana", "apple", "raspberry");$fruit = array_pop($stack
As mentioned earlier, JMSCorrelationID is mainly used to associate multiple messages. For example, when a Message needs to be repliedSet JMSCorrelationID to the ID of the original message. In the following example, three message producers A, B, C and three message consumers A, B, and C are created. Producer A sends A message to consumer A, and consumer A needs to send A message to consumer. B and C are similar to.The diagram is as follows:Producer A ----- send ----> consumer A ----- reply ------
Maven DependencyMaven's dependency uses the invisible dependency transitivity, and if it just uses the JMS function to reference maven coordinates,Depending on the transitive relationship, it is visible that the SPRINGJMS will import other dependent packages invisiblySpring NamespaceSpring-config.xml supports SPRING-JMS namespaces and uses namespace to simplify the configuration of SpringSpring BeansThe bas
directly invokes some methods on the service side. The advantage is the strong type, the compile time can check the error, the disadvantage is only based on the Java language, the client and the server tightly coupled.3. JMSThe JMS (Java Messaging Service) is a Java messaging service that allows asynchronous message transmission between JMS clients through the JMS
. The advantage is the strong type, the compile time can check the error, the disadvantage is only based on the Java language, the client and the server tightly coupled.JMS (Java Messaging Service)JMS is a Java messaging service that allows asynchronous message transmission between JMS clients through the JMS service. JMS
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.