The Message notification mechanism may be used when various organizations in an enterprise collaborate with each other. For example, if something is updated, You can notify the index.
Multiple implementations of JMS are available in Java. Activemq in Apache is a good choice. Activemq is the most popular and powerful open-source message bus produced by Apache.
It programmer development Essentials-all kinds of resources download list, history of the most IT resources, personal collection summary.
Based on Spring+jms+activemq+tomcat, the version I'm using is as follows: Spring 2.5 ActiveMQ 5.4.0 Tomcat 6.0.30
The following learning and configuration, to achieve the basic mes
ClientID can not be the same. Let's take a look here.
The project structure is as follows:
Project Structure Introduction:
1, a message producer, two message consumers and a listener class is Mymessagelistener.java, the same as the asynchronous processing of messages and heavy activemq.
2, three profiles are the message producer's configuration file and the message consumer's profile.
The other is related to the previous relevant demo here on the ab
This article is a simple way to integrate spring and ACTIVEMQ, only for reference learning, with a focus on understanding the concept.
1:JMS is a standard API developed by Sun to access message-oriented middleware (MOM), and the MOM component in this article is activeMq. You can download activeMq packages to the http:
Org.springframework.jms.connection.singleconnectionfactory$sharedconnectioninvocationhandler.localstart (Singleconnectionfactory.java:632) at Org.springframework.jms.connection.singleconnectionfactory$sharedconnectioninvocationhandler.invoke ( Singleconnectionfactory.java:569) at Com.sun.proxy. $Proxy 189.start (Unknown Source) truncated. See Logfile forComplete StackTraceWorkaround:Modify the Amqconnectionfactory configuration as follows: ActiveMQ
Introduce dependencies: Configuration file:Spring:activemq:broker-URL:TCP://127.0.0.1:61616In-memory:truepool:enabled:falsemail:host:smtp.163. com username: Your mailbox password: Your password properties:mail:smtp:truestarttls:enable:trueRequired:trueFreemarker:allow-request-override:falseCache:trueCheck-template-location:trueCharset:utf-8content-type:text/HTML Expose-request-attributes:falseExpose-session-attributes:falseExpose-spring-macro-h
The directory after ACTIVEMQ is extracted as follows:
Each directory is described as follows: Bin:activemq's startup script conf:activemq all profile data: Log file and persistent message DOCS:ACTIVEMQ official documentation EXAMPLES:ACTIVEMQ the official demo LIB:ACTIVEMQ Run the required library WEBAPPS:ACTIVEMQ Web console WEBAPPS-DEMO:ACTIVEMQ WebApps related demo ACTIVEMQ-ALL-5.13.2.JAR:ACTIVEMQ CLI ja
1: The database uses the DBCP configuration.destroy-method= "Close" >2: Configure ConnectionFactory link Factorydestroy-method= "Stop" >3: Set the MQ mode to queue for asynchronous receive.4: Your Consumer implementation class, handling the main function that receives the message.5: Message monitoring container, here unified implementation of the ACTINMQ message receiving mechanism.The values within the 6:$ are recorded through the properties file and support the changes.Beginner
**exception in thread "main" org.springframework.jms.UncategorizedJmsException:Uncategorized Exception occured during JMS processing; Nested exception is javax.jms.JMSException:Failed to build body from content. Serializable class not available to broker. Reason:java.lang.ClassNotFoundException:Forbidden class springactivemq.activemqtest.person! This class was not a trusted to being serialized as ObjectMessage payload.* Reason: Activemq's objectmessage relies on the serialization and deserializa
The message type used in this example is mapmessage.CodeIt's relatively simple. Post it for you to see:
Receive message:
Private void receive () {var factory = new connectionfactory (program. brokeruri); var timeout = new timespan (0, 0, 10); Using (VAR connection = factory. createconnection () {using (VAR session = connection. createsession () {var Destination = sessionutil. getdestination (Session, program. normalqueuedestination); Using (VAR con
[Spring tutorial] create a simple spring example, spring Tutorial example
1. First, the main idea of spring is dependency injection. Simply put, there is no need to manually create new objects, and these objects are managed by the
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.