In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
First, about JMS1. The basis of JMS
JMS is a set of technical specifications provided by Java. Java message Service (Java message service). Application program interface. Is a Java platform on message-oriented middleware API. Used to send messages between two applications or in distributed systems for asynchronous communication. Java message service is an API independent of specific platform.
is used for heterogeneous systems to integrate communication and alleviate system bottlenecks. Improve the scalability of the system and enhance the system user experience. It makes the modularization and componentization of the system feasible and more flexible.
Three specifications of JAVA2EE: https://blog.csdn.net/qq_41637061/article/details/84640947
2. JMS message transmission model (1) point-to-point
The peer-to-peer model is usually a pull-or polling-based messaging model that requests information from the queue rather than pushing the message to the client. The characteristic of this model is that the message sent to the queue is processed by one and only the recipient, even if there are multiple message listeners. Generally speaking, it is one-to-one, the consumer actively pulls the data, and the message is cleared after receiving the message.
(2) publish / subscribe model
The publish and subscribe model is a push-based messaging model. The publish subscription model can have many different subscribers, temporary subscribers receive messages only when actively listening to topics, while persistent subscribers listen for all messages on topics, even if the current subscriber is unavailable and offline.
3.JMS core components
Destination: the destination to which the message is sent, that is, Queue and Topic mentioned earlier.
Message: literally, you can see that the message was sent.
Producer: the producer of a message that sends a message that must be sent through this producer.
MessageConsumer: corresponding to the producer, this is the consumer or receiver of the message, through which a message is received.
There are many types of message:
StreamMessage:Java data stream messages are sequentially populated and read with standard stream operations.
MapMessage: a message of type Map; the name is of type string, and the value is the basic type of Java.
TextMessage: a normal string message containing a String.
ObjectMessage: a binary array message containing a byte [].
XMLMessage: a message of type XML.
One of the most commonly used is TextMessage and ObjectMessage.
4. Common message queuing service (1) ActiveMQ
ActiveMQ is the most popular and powerful open source message bus produced by Apache. ActiveMQ is a fully supported JMS1.1 and J2EE 1.4 specification.
features:
-producers, servers, and consumers can all be distributed
-message storage order write
-extremely high performance and high throughput
-support message order
-client pull, random read, using sendfile system call, zero-copy, batch pull data
-supports consumer-side transactions
-supports message broadcast mode
-support for sending messages asynchronously
-supports http protocol
-data migration and expansion are transparent to users
-supports both synchronous and asynchronous replication HA
(2) RocketMQ
RocketMQ is a distributed message middleware with queue model.
features:
-ensures strict message order
-provides rich message pull patterns
-efficient subscriber-level scalability
-Real-time message subscription mechanism
-100 million message stacking capability
Second, the basic introduction of kafka. 1. Introduction of Kafka
kafak is a distributed, publish / subscribe based messaging system. The ability of message persistence is provided in the way of time complexity O (1), which can guarantee the access performance of constant time complexity even for data above TB level. High throughput. Even on very cheap commercial machines, it is possible to support the transmission of more than 100K messages per second on a single machine. Support message partitioning between Kafka Server, and distributed consumption, while ensuring the sequential transmission of messages within each Partition. Both offline data processing (hive, HBASE) and real-time data processing (spark, storm) are supported.
Advantages of 2.kafka
-decoupling: allows both sides of the process to be extended or modified independently, as long as they follow the same interface constraints.
-redundancy: message queues persist data until they have been fully processed, avoiding the risk of data loss. Save until you have finished using.
-Extensibility: it is easy to increase the frequency of message queuing and processing
-flexibility & Peak processing capacity: message queuing enables critical components to withstand sudden access pressures without completely collapsing due to sudden overloaded requests.
-recoverability: when some components of the system fail, it does not affect the entire system.
-order guarantee: Kafka guarantees the ordering of messages within a Partition.
-buffering: message queuing uses a buffer layer to facilitate the most efficient execution of tasks. The processing of writing to the queue is as fast as possible. This buffer helps to control and optimize the speed at which data flows through the system.
-Asynchronous Communication: message queuing provides an asynchronous processing mechanism that allows users to put a message on the queue, but does not process it immediately. (put as much as you want and deal with it when you need it)
Characteristics of 3.kafka
-High throughput, low latency: kafka can process hundreds of thousands of messages per second, with a delay of at least a few milliseconds.
-scalability: kafka clusters support hot expansion
-Reliability: messages are persisted to the local disk and data backup is supported to prevent data loss
-fault tolerance: allow nodes in the cluster to fail
-High concurrency: supports thousands of clients to read and write simultaneously
Application scenarios of 4.kafka
classic architecture: Flume + Kafka + Storm / spark streaming+ Redis.
application scenarios: message system, tracking website activity, operation metrics, log aggregation, flow processing, log collection, log submission.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.