messaging middleware subscription, and the systems are not affected by each other.JMS OverviewJMS is the abbreviation for the Java Message service, Java messaging, which is a specification for messages in Java EE, and Hornetq, ACTIVEMQ, and so on, are implementations of this specification. If it is an enterprise or some small system, it is an economical choice to use JMS directly, and there are some scenarios in large-scale systems that are not suita
JMS learning SUMMARY iii
JMS body, phase, and usage
JMS is a Standard Specification for generating, sending, and receiving messages.
Multi-Application system communication can be implemented based on JMS specifications
Supports secure topic message transmission, transactional messages, consistent messages, and
After integration with WebSphere mq6, was 6 needs to send JMS messages to MQ in EJB (Session Bean and message Bean. The EJB itself is in the JTA transaction environment of the container, and JMS is also included in the transaction management by default. Therefore, you must select "xa support enabled" for the configuration of the connection factory. this attribute will enable
In the following example, two queue are created, and the sender sends a message to one queue. After receiving the message, the receiver replies a message to the other queue, then create a consumer to receive the reply message.
/*** @ Author administrator * @ Description: first, create two queue. The sender sends a message to one queue. After receiving the message, the receiver replies a message to the other queue, then create a consumer to accept the reply message */package COM. WL.
and receiving policy
One-to-multiple message publishing and receiving policies. When multiple sub listening to the same topic address can receive messages sent by publisher. The Sub receives the notification to the mq server.
One-to-one message publishing and receiving policy. Only one receiver can receive messages sent by one sender. After the receiver receives the message, it notifies the mq server that it has received the message. the mq server deletes the message in the queue or perfo
(subscriber). The client sends the message to the topic. Multiple publishers send messages to topic, which the system passes to multiple subscribers. Each message can have multiple consumers There is a time dependency between the Publisher and the Subscriber. Subscribers to a topic (TOPIC) must create a subscription before they can consume the publisher's message and, in order to consume the message, the Subscriber must remain in a running state.Of course, to mitigate this strict time depende
1. Basic concepts of JMS 1. JMS (Java Message Service) is a standard API used to access the enterprise message system. It facilitates message systems.Java applications in the system exchange messages, and simplify the development of enterprise applications by providing standard interfaces for generating, sending, and receiving messages.
2. Basic JMS FunctionsJMS
As it is, continue to improve the J2EE technical specifications. This time, we will write a JMS program. Understand the message-oriented middleware definition: Message
(1) message is a programmable mechanism for communication between two ends
(2) Some messaging technologies such:
TCP/IP sockets
MPs queue
File
Shared storage
Asynchronous Message:
(1) asynchronous message:
It is better to use asynchronous messages for Syn
Introduction to JMS
JMS (Java Message Service ). It is used to transmit messages between applications.
Enterprise Message
WebSphere MQ, SonicMQ, Microsoft Message Queue (MSMQ), ActiveMQ, Message Bean in EJB, and ESB (Enterprise Message Bus) in SOA are all Enterprise messages.
Enterprise Message can be used in the following ways:
Centralized
Distributed
Hybrid
Install a Daemon program on each Client. T
Today, most computing environments are made up of different platforms rather than sticking to any platform. The Java Messaging Service (JMS), together with Extensible Markup Language (XML), satisfies the desire for this heterogeneous environment integration. This article demonstrates how to use JMS to create xml-based messages and distribute them equally to Java and non-Java applications.
After several yea
1: ActiveMQ Zookeeper-based master-slave (LevelDB master/slave) construction and Spring-boot use (http://www.cnblogs.com/yshyee/p/7277801. HTML), the following code is used to send the JMS message:@Service Public class Producer { @Autowired private jmsmessagingtemplate jmstemplate; Public void Final String message) { jmstemplate.convertandsend (destination, message);} }After using JMe
1,mqMQ (Message queue) Message Queuing means a technique for applying communication , storing messages by creating a queue, adding an application communication message by adding a queue element, and reading the application communication message by retrieving the queue;2,jmsThe JMS (Java message Service) Java Messaging Service, which is a set of Java APIs;JMS is a vendor-agnostic API used to access messaging
Different from Queue, a Topic implements a publishing/subscription model. In the following example, two consumers are started to listen to a Topic, then, multiple messages are repeatedly sent to the Topic.
Import javax. jms. Connection;Import javax. jms. JMSException;Import javax. jms. Message;Import javax. jms. Messag
In the following example, two queue are created, and the sender sends a message to one queue. After receiving the message, the receiver replies a message to the other queue, then create a consumer to receive the reply message.
Import javax. JMS. connection;Import javax. JMS. jmsexception;Import javax. JMS. message;Import javax.
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 o
The cost of creating a connection from a WebSphere application Server to a Java message Service (JMS) provider, such as WebSphere MQ, is very high both in terms of time and processor requirements. To improve performance, WebSphere application Server maintains an idle connection pool that provides idle connections to applications when the application requests a connection to a JMS provider. This two-part art
asynchronous framework, and the ACTIVEMQ is to avoid the loss of messages by retrying.
The latter's data cannot be recovered and not controlled by business-side programming. The OP needs to be guaranteed as much as possible through certain mechanisms.
Pasted from:
The background here ... http://activemq.apache.org/should-i-use-xa.html typically you either need to implement Your own duplicate message detector usean idempotent consumer ... Power and other consumers. Core critica
1. Place the jar file connected to the MySQL database in the activemq Lib directory2, modify the ACTIVEMQ conf directory active.xml file, modify the way data persisted2.1 How to modify the persisted data of the original KSHADB2.2 Connect the configuration of MySQL (note the location of the configuration file placement)class= "Org.apache.commons.dbcp.BasicDataSource" destroy-method= " Close "> 3. Persist data to MySQL operation3.1 Restart Activemq, and run the program, put persistent dat
Introduce an article first: http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html?page=1
But it's a little long, and now I've forgotten what I said. Pay attention to the comments, which refer to the content of the article is wrong.
In spring, if there are both JMS operations and DB operations, there are probably three ways:
1. No use of JTA. JMS not in transaction, DB operation in tra
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.