Java Message Service Preliminary learning (based on spring in action collation)

Source: Internet
Author: User

A few nouns
    • The Java Message Service is a Java standard that defines a common API for using the message broker.
    • Message Broker: Similar to the role of a post office, ensure that messages are delivered to the specified destination.
      • ActiveMQ
      • Kafka
    • Destination (destination)
      • Queues (queue, point-to-point model): Messages can have multiple recipients, but each message is only taken away by one recipient.
      • Topic (topic, point-to-line model): Subscribers who subscribe to this topic receive a copy of this message.
Advantages of asynchronous messages compared to synchronous messages
    • Time: Asynchronous messages do not need to wait for the server to return, just send a message.
    • Location: A network location that is not dependent on the server.
    • Decoupling: You do not need to know the service interface of the server.
    • Security: Even when a message is sent, the service does not run properly, and the message is stored until the service can be reused.
Spring support for JMS, including jmstemplate and message-driven Pojo
    • Jmstemplate effect: Eliminate lengthy and repetitive JMS code, create connections, get sessions, and send and receive messages, allowing developers to focus on building messages to be sent or processing received messages, capturing subclass-check exceptions for thrown jmsexception exceptions, and re-throws the subclass of the corresponding JMSException exception non-check type exception.
    • Message-driven bean (Message-driven bean,mdb): You do not have to proactively view the queue or topic for a message (return or timeout), passively wait for a message to arrive at a notification, and resolve the blocking issue before the message is available to the synchronization message.

Java Message Service Preliminary learning (based on spring in action collation)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.