message is called the publisher, the person who gets the message, the Subscriber.
Kimmking: After the message is sent out, you need to put it on a "place" on the server, where we call the destination destination
KIMMKING:PTP destination, we call it the queue.
Kimmking:pub/sub destination, we call topic.
Kimmking: Note that the JMS specification is very similar to the JDBC specification and is a simple clie
: // 127.0.0.1: 10389 /");
Dircontext CTX = new initialdircontext (ENV );
Java MES (JMS) is an application interface (API) used to communicate with message-oriented middleware ). It supports point-to-point domains, publish/subscribe domains, and supports the following types: Approved message transmission and transactional message transmission, supports consistent messages and persistent subscribers.
The JMS
In today's projects, there are more and more distributed programs. In the SOA architecture, various services are transmitted through messages for mutual calls. Therefore, JMS, as a Java Message mechanism, should be well grasped, of course, Web services do not directly call JMS APIs.
This article focuses on the specific use of JMS in jboss4. The implementation of
What happens if the phone only has real-time calls and no messages and text messages? A phone call came, just didn't have time to pick up, then the phone to send the message must not be received. Why not save the information first and then get the information when the user needs to see it? Along with this doubts, short-term interest and message came into being, whether the phone is turned on or not, we can get the information. JMS provides something l
In the previous article, the author presented an example of the process of developing Java EE applications in was CE v2.1, covering many of the new features of Java EE 5, including: Java Server Faces (JSF), Java Persistence API ( JPA), Enterprise Java Bean (EJB), and Jax-ws 2.0. As a second article in this series, this article introduces another technical--JMS (Java message Service) of Java EE 5.
Introduction to
, and transactional support for businesses that need to reliably exchange messages in large quantities.
2. Message Delivery model
MS supports two types of messaging models: The Point-to-point model and the Publish/Subscribe model . These messaging models are known to be messaging domains. The point-to-point messaging model and the publish/subscribe Messaging model are often abbreviated to peer and pub/sub, respectively.
The Publish/subscribe model is designed for one-to-many (o
, and sometimes not programming, to transfer messages directly to and from WebSphere MQ. Of course, most of the cases need to be programmed for JMS client
Ii. Basic concepts of JMS
As mentioned earlier, the implementation of JMS, called the JMS provider, can be considered a JMS
[Original] JMS achieves Distributed Transaction consistency and jms transaction consistencyThe topic of distributed transactions has always been a controversial topic. Here we will give a simple demo of how to implement distributed transactions using message-oriented middleware, it also allows you to gain experience and think about distributed transactions in practice. 1. Local transaction
After configuring
destination objects: queue and topic.1.2 message Submission mechanism for Web ApplicationsGenerally, no message is allowed to be lost or duplicated in desktop applications, whether it is a message sender or receiver. the JMS message Submission mechanism is based on this requirement and they guarantee the implementation of this requirement from different aspects: ① control the message confirmation at the re
consists of a header and a message body. The header consists of route information and metadata about the message. The message body carries the data or load of the application. Based on the type of the payload, messages can be divided into several types, including TextMessage, ObjectMessage, and MapMessage), BytesMessage, StreamMessage, and Message without a payload ). The message sending and receiving system is asynchronous, that is, the JMS client
Some Learning ExperiencesP2P mode:Concept: three roles: queue, queuesender, queuereceiver, queue, message sender, and message receiver. The sender adds a message to the queue. The receiver fetches the message from the queue. one message in the queue receives one fewer messag
through a third-party broker, which is equivalent to a post office, when a client sends a message, it only sends the message content to the broker and notifies the broker to send the message to the address. The rest is done by the broker. The client does not have to wait and can perform any other operations, the main responsibility of the broker is to ensure message delivery. We can only listen to the broker to receive messages. After comparison, I believe that you have a preliminary understand
(sender) is sent to the message Queue (queue), It is not removed from the message queue until the message receiver (receiver) receives it, and the message that is not received will always exist in the JMS container. This approach is a bit like postal communications, with only one recipient of the letter, which is kept
There are more and more distributed programs in the current project, under the architecture of SOA, various services call each other as messages, so JMS as a Java message mechanism should be well mastered, of course, like Web Services is not a direct call to JMS API.
This article is mainly about the specific use of JMS in the JBOSS4, JBoss in the implementation o
. The initialized size of the cache is set to 1, using the4. Core ModuleProvides the core functionality of using JMS.When using jmstemplate, you only need to inherit the callback interface, you can define a high-level protocol by inheriting the call interface, and the Messagecreator callback interface creates a message at the specified session. It can only be called by Jmstemplate. To meet the more complex applications of the JMS API, Sessioncallback
. For consumption, JMS messages can consume messages in two ways.0 synchronizationA subscriber or receiver calls the Receive method to receive a message, and the receive method blocks until it is able to receive the message (or before it times out)0 AsyncSubscribers or receivers can register as a message listener. When the message arrives, the system automatically calls the listener's OnMessage method.
JMS
The preliminary work is omitted from the table.
The Code is as follows:
Messagereceiver
Package JMS. activemq. myexample; import javax. JMS. connection; import javax. JMS. destination; import javax. JMS. jmsexception; import javax. JMS. message; import javax.
Create a message queue on the JBoss server
We can create message queues in the following 4 ways: Management Console Management CLI deployment *-jms.xml file to deployments directory edit JBoss configuration file using Management Console creating Message Queuing
1. Start JBoss with messaging, that is, when you start JBoss, use the-C or--server-config= to a configuration file that points to JBoss Standalone-full.xml
./standalone.sh-c Standalone-ful
Messageconsumer, so that whenever a message arrives, the JMS Provider invokes the OnMessage method in MessageListener.5. PTP ModelThe PTP model is point-to-point, the sender sends messages to the queue, the receiver receives the message from the queue, and the presence of the queue makes the asynchronous transmission
architecture emerged, so JMS came out.
Here, we use Programming to Implement message transmission in the PTP model. Of course, either model is inseparable from the message server.
Because the server is based on the weblogic12c server, and the version of 12 has changed significantly compared with the previous version, to create a queue, you must first create a 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.