Activemq face question

Source: Internet
Author: User

    1. What is activemq
ACTIVEMQ is an open-source, JMS1.1-compliant, message-oriented (MOM) middleware that provides efficient, scalable, stable, and secure enterprise-class messaging for applications.
    1. ACTIVEMQ The role and principle of
The role of ACTIVEMQ is to communicate between systems. Of course, you can use other methods for inter-system communication, if you use Activemq, you can decouple the calls between systems to achieve asynchronous communication between systems. The principle is that producers produce messages and send messages to ACTIVEMQ. ACTIVEMQ receives the message, then looks at how many consumers there are and then forwards the message to the consumer, a process in which the producer does not need to participate. The consumer does not have any relationship with the producer after receiving the message and doing the corresponding processing
    1. ACTIVEMQ Several ways of communication
3.1publish ( Publish )-subscribe ( Subscribe )( Publish - How to subscribe )How the Publish/subscribe method is used for multi-receive clients. As a way to publish a subscription, there may be multiple receive clients, and there is a time-dependent dependency on the receiving client and the sending client. A receiving end can only receive information that he sends after the client is created. As a subscriber, there are two ways to receive messages, the destination receive method, and the OnMessage method that implements the message listener interface. 3.2 Peer (point-to-point) ( Point-to-point )It's easier to understand the peer-to-peer process. It is like two people call, these two people are exclusive of this communication link. One party sends a message, the other party receives it, it's that simple. In practice, because there are multiple users communicating with each other using a peer-to link, they communicate through a queue-like approach. The difference between the pub-sub and the front is that a topic has a sender and multiple receivers, while in the peer-to-peer queue there is only one sender and one receiver.
    1. Publish ( release )-subscribe ( subscription ) Way of Handling
The mode of communication for the publish subscription pattern is notified only once by default, and is not available if you do not receive this message. This scenario only applies to cases where the message delivery rate is not high. You need to configure a durable subscription if you require that messages must be delivered without loss. Each subscriber defines an ID, < PropertyName= "ClientId" in the subscription is toACTIVEMQ Registration. Publish Message < property name= "Subscriptiondurable" value= "true" /> and receive messages when you need to configure the Send mode for persistent Template.setdeliverymode (DeliveryMode.  Persistent);. At this point, if the client does not receive the message, the message is persisted to the service side (that is, on the hard disk) until after the client is properly received.
    1. 4.2p-p (Point-to- point ) Way of Handling
Point-to-point mode if the message is sent unsuccessfully this message is saved by default toACTIVEMQ the server until a consumer consumes it, so the message is not lost at this time.
    1. How to resolve message duplication issues
The so-called repetition of the message is that the consumer received a duplicate message, in general, we deal with this problem to grasp the following points, ①. The message is not lost (it has been processed) ②. Message is not repeated in general, we can add a table to the business segment to hold the message executed successfully. Every time a business thing commits, it informs the server that the message has been processed, so that even if your message is re-sent, it will not result in a repetitive process as follows: The business-side table record has processed the ID of the message, each time a message comes in to determine whether the message has been executed, if executed before giving up, If the message is started without execution, the ID of the message is deposited after the message execution is completed

Activemq face question

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.