CN110956485A - Message subscription method and component based on RocktMQ and message subscription system - Google Patents

Message subscription method and component based on RocktMQ and message subscription system Download PDF

Info

Publication number
CN110956485A
CN110956485A CN201811136394.8A CN201811136394A CN110956485A CN 110956485 A CN110956485 A CN 110956485A CN 201811136394 A CN201811136394 A CN 201811136394A CN 110956485 A CN110956485 A CN 110956485A
Authority
CN
China
Prior art keywords
message
subscription
rule
consumer
filtering rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811136394.8A
Other languages
Chinese (zh)
Other versions
CN110956485B (en
Inventor
蒋文倩
徐盛
汤严敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qianxun Spatial Intelligence Inc
Original Assignee
Qianxun Spatial Intelligence Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qianxun Spatial Intelligence Inc filed Critical Qianxun Spatial Intelligence Inc
Priority to CN201811136394.8A priority Critical patent/CN110956485B/en
Publication of CN110956485A publication Critical patent/CN110956485A/en
Application granted granted Critical
Publication of CN110956485B publication Critical patent/CN110956485B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0631Item recommendations

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • Theoretical Computer Science (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Game Theory and Decision Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention is suitable for the technical field of Internet of things, and provides a message subscription method and a component based on a RocktMQ and a message subscription system, wherein the message subscription method comprises the following steps: adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier; when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification; corresponding consuming logic is executed. In the invention, the message subscription granularity of the message consumer is thinned to the message identification level, so that when a new service purpose is generated, only one message consumer needs to be newly added, and the service risk brought by the change implementation is reduced.

Description

Message subscription method and component based on RocktMQ and message subscription system
Technical Field
The invention belongs to the technical field of Internet of things, and particularly relates to a message subscription method and component based on a RocktMQ and a message subscription system.
Background
In an e-commerce system, asynchronous messages are generally required to be sent and received, decoupling between different projects is achieved, for example, asynchronous sound logs after orders are created, shopping carts are cleared, notification mails are sent, and the like. Different message identifications (tags) correspond to different conditional branches, and different consumption logics are realized. However, each new service scenario needs to add a conditional branch to the original consuming logic, which is very invasive to the service logic and inconvenient for service maintenance and management.
Currently, there is the following way to integrate a socket Message Queue (MQ) in a Spring framework.
1) The message producer and consumer are defined as bean objects to be managed by Spring containers.
2) And using an external item of a Rockettq-spring-boot-starter of a RockettMQ to send and receive messages.
In the above scheme, encapsulation and management of a rocktmq producer (Product) and a Consumer (Consumer) in the scheme can be realized, but messages are still subscribed through topic, and conditional judgment is performed through tag to filter the messages. When there is a new business purpose, the consumption logic of the Consumer needs to be changed.
Disclosure of Invention
The embodiment of the invention provides a message subscription method and component based on a RocktMQ and a message subscription system, aiming at solving the problem that when a new service purpose is generated in the prior art, because a conditional branch needs to be added on an original message consumer list, the service risk caused by the realization of change is increased.
A message subscription method based on a RocketMQ comprises the following steps:
adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification;
corresponding consuming logic is executed.
Preferably, a plurality of message consumers with different message identifications are included under the same message subject.
Preferably, the adapting the subscription rule and the message filtering rule in the message consumer list includes:
merging the message consumers with the same message subject and the same message identification;
and automatically subscribing all messages under the message topic when the message identification is not specified.
Preferably, before adapting the subscription rule and the message filtering rule in the message consumer list, the method includes:
automatically loading the message consumer implementing a message consumption interface class into the message consumer list;
and completing the creation of the message consumer by unified management.
Preferably, before adapting the subscription rule and the message filtering rule in the message consumer list, the method includes:
the method is characterized in that the message producer is managed uniformly, the life cycle of the message producer object is divided into three methods, namely, a construction function, instantiation and cleaning.
Preferably, the dividing the life cycle of the message producer object into three methods of constructor, instantiation and cleaning comprises:
the message producer object group name and the NameServer address are used as attributes and provided by a Spring container during configuration;
instantiating the message producer object, setting a NameServer address, and initializing the message producer object;
clearing resources when the message producer object is destroyed.
The invention also provides a message subscription component based on a RockettMQ, which is characterized by comprising the following components:
the adaptive unit is used for adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
the searching unit is used for polling the message consumer list and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification when receiving the message notification;
and the execution unit is used for executing corresponding consumption logic.
The invention also provides a message subscription system based on the RocketMQ, which comprises a message subscription component based on the RocketMQ, wherein the message subscription component comprises:
the adaptive unit is used for adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
the searching unit is used for polling the message consumer list and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification when receiving the message notification;
and the execution unit is used for executing corresponding consumption logic.
The present invention also provides a memory storing a computer program, wherein the computer program is executed by a processor to perform the steps of:
adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification;
corresponding consuming logic is executed.
The invention also provides a message subscription component, comprising a memory, a processor and a computer program stored in the memory and operable on the processor, wherein the processor implements the following steps when executing the computer program:
adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification;
corresponding consuming logic is executed.
In the embodiment of the invention, the message subscription granularity of the message consumer is thinned to the message identification level, so that when a new service purpose is generated, only one message consumer needs to be newly added, and the service risk brought by the implementation of change is reduced.
Drawings
Fig. 1 is a flowchart of a message subscription method based on RocketMQ according to a first embodiment of the present invention;
FIG. 2 is a diagram illustrating the formation of a message consumer list according to the present invention;
FIG. 3 is a diagram illustrating subscription rules and message filtering rules in accordance with the present invention;
fig. 4 is a flowchart of a preferred mode of a message subscription method based on a RocketMQ according to the first embodiment of the present invention;
FIG. 5 is a diagram of an implementation class of a message consumer provided in accordance with a first embodiment of the present invention;
FIG. 6 is a diagram of implementation classes of a message producer provided in accordance with a first embodiment of the present invention;
fig. 7 is a structural diagram of a message subscription component based on a RocketMQ according to a second embodiment of the present invention;
fig. 8 is a block diagram of a preferred manner of a message subscription component based on a RocketMQ according to the second embodiment of the present invention;
fig. 9 is a structural diagram of a message subscription system based on RocketMQ according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the embodiment of the invention, a message subscription method based on a RockettMQ comprises the following steps: adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier; when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification; corresponding consuming logic is executed.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
The first embodiment is as follows:
fig. 1 shows a schematic diagram of the formation of a message consumer list in the present invention. As shown in fig. 1, the message consumer component may include multiple projects, where one project may include multiple consumers consuming messages, and the messages in the message consumer component are obtained by obtaining messages sent by message producers, and specifically, may be obtained by obtaining messages sent by multiple message producers. The message producer component includes a plurality of projects, each project having a message producer sending a message.
Fig. 2 shows a flowchart of a message subscription method based on a RocketMQ according to a first embodiment of the present invention, where the method includes:
step S1, adapting a subscription rule and a message filtering rule in a list of message consumers (consumers), wherein the subscription rule and the message filtering rule are related to a message topic (topic) and a message identifier (tag).
Specifically, a plurality of messages are included under the same message subject to identify different message consumers. As shown in FIG. 3 in particular, message consumer A consumes Topic "A", Tag "1", message consumer B consumes Topic "A", Tag "2", message consumer C consumes Topic "B", Tag "1", and message consumer D consumes Topic "B". Subscription rules and message filtering rules are associated with topoc and Tag, such as the subscription rule and message filtering rule Topic "a", Tag "1 | | 2" is used to indicate that the message Topic is "a" and the message is identified as "1" or "2", subscription rule and message filtering rule Topic "B", Tag "is used to indicate that all messages with the message Topic" B ".
In step S1, merging the message consumers whose message subject and message identification are the same; and automatically subscribing all messages under the message topic when the message identification is not specified. I.e. the message identity is not specified, all message consumers under the message topic are merged.
After step S1, a listening interface is registered with the message consumer object for listening for message notifications.
Step S2, when receiving the message notification, polling the message consumer list to find the message consumers corresponding to the subscription rule and the message filtering rule in the message notification.
Specifically, at least the message topic is included in the message notification. If the message identification is not specified, all message consumers under the message subject in the message consumer list are searched. If the specified message identification exists, all message consumers with the same message subject and the same message identification in the message consumer list are searched. Thus, the message subscription granularity of the provider is refined to the tag level, developers can realize the providers of message consumption interface (Lyramqprovider) interfaces according to the service logic definition, the providers can be different topocs and tags, and can also be different tags under the same topoc, so that the message subscription mode is more flexible, and the processing and the distinguishing of the service logic are convenient.
Step S3, executing the corresponding consumption logic;
and when the application exits, the message consumer object is destroyed, and simultaneously resource cleaning and closing of network connection are completed.
In the embodiment, the message subscription granularity of the message consumer is refined to the message identification level, so that when a new service purpose is generated, only one new message consumer needs to be added, and the service risk brought by the implementation of change is reduced.
In a preferable embodiment of this embodiment (see fig. 4), the step S1 further includes:
and step S01, automatically loading the message consumers realizing the message consumption interface class into the message consumer list.
And step S02, the unified management completes the creation of the message consumer.
Specifically, the message consumers are managed uniformly, as shown in fig. 5, the life cycle of the message consumer object is divided into three methods, namely constructor, instantiation (init) and cleaning (destroy). More specifically, the message consumer object group name and the NameServer address are used as attributes and provided by a Spring container during configuration; instantiating the message consumer object, setting a NameServer address, and initializing the message consumer object; clearing resources upon destruction of the message consumer object.
In the embodiment, the Consumer list is managed in a unified manner; and the message subscription granularity of the Consumer is refined to a tag level. The method can subscribe different tags under the same topic for multiple times without violating a RockettMQ (MessageQueue ) and subscribing different tags under a certain topic for multiple times, and the message queue can cover the problem of the former, so that the business logic can be conveniently identified. Thus, the message pushing and receiving process is simplified, and the learning cost of developers using the RockettMQ is minimized. And the message subscription granularity of the Consumer is refined to tag level, developers can realize the Consumer of the LyramqConsumer interface according to the service logic definition, and the Consumers can be different topoics and tags and can also be different tags under the same topoic, so that the message subscription mode is more flexible, and the processing and the distinguishing of the service logic are convenient.
In a preferred embodiment of the present embodiment, before step S1, the message producer is managed uniformly, as shown in fig. 6, the life cycle of the message producer object is divided into three methods, namely, constructor, instantiation (init) and cleanup (destroy). The method specifically comprises the following steps: the message producer object group name and the NameServer address are used as attributes and provided by a Spring container during configuration; instantiating the message producer object, setting a NameServer address, and initializing the message producer object; clearing resources when the message producer object is destroyed. And the main method send of message sending completes the unified conversion of the data format of the message entity and the message sending.
The embodiment is based on a conventional method of integrating RocktMQ in a Spring framework, abstracts the implementation manners of original message producers and message consumers, uniformly manages the initialization, configuration, definition and binding of message listener objects, resource cleaning, network connection closing and the like of the message producers and the message consumers, and meanwhile, refines the granularity of message subscription to a tag level.
Example two:
as shown in fig. 7, a structure diagram of a message subscription component based on rockmq according to a second embodiment of the present invention includes: adaptation unit 1, the search unit 2 of being connected with adaptation unit 1, the execution unit 3 of being connected with search unit 2, wherein:
the system comprises an adaptation unit 1, a message processing unit and a message processing unit, wherein the adaptation unit is used for adapting a subscription rule and a message filtering rule in a message consumer list, and the subscription rule and the message filtering rule are related to a message theme and a message identifier;
specifically, a plurality of messages are included under the same message subject to identify different message consumers. The adaptation unit 1 merges the message consumers with the same message subject and the same message identification; when the message identifier is not specified, the adaptation unit 1 automatically subscribes to all messages under the message topic. I.e. the message identity is not specified, the adaptation unit 1 merges all message consumers under the message topic.
After adapting the subscription rule and the message filtering rule in the message consumer list, the adapting unit 1 registers a monitoring interface for monitoring the message notification to the message consumer object.
The searching unit 2 is configured to poll the message consumer list when a message notification is received, and search the message consumers corresponding to the subscription rule and the message filtering rule in the message notification;
specifically, at least the message topic is included in the message notification. If the message identification is not specified, the searching unit 2 searches all message consumers in the message consumer list under the message subject. If there is a specified message identification, the search unit 2 searches all message consumers in the message consumer list whose message subject and message identification are the same. Thus, the message subscription component in this embodiment refines the message subscription granularity of the provider to the tag level, and a developer can implement the provider of the lyramqcprovider interface according to the service logic definition, and the providers may be different topics, tags, or different tags under the same topic, so that the message subscription mode is more flexible, and the processing and the distinguishing of the service logic are facilitated.
An execution unit 3 for executing the corresponding consuming logic;
when the application exits, the execution unit 3 destroys the message consumer object, and completes resource cleaning and closing of network connection.
In the embodiment, the message subscription component refines the message subscription granularity of the message consumer to the message identification level, so that when a new service purpose is generated, only one new message consumer needs to be added, and the service risk brought by the implementation of change is reduced.
In a preferred aspect of this embodiment, as shown in fig. 8, the message subscription component further includes: a creation unit 5 connected to the adaptation unit 1 and a loading unit 4 connected to the creation unit 5, wherein:
a loading unit 4, configured to automatically load the message consumer who implements the message consumption interface class into the message consumer list;
the creating unit 5 is used for managing and completing the creation of the message consumer.
In particular, the message subscription component provides for unified management of message consumers. The loading unit 4 divides the life cycle of the message consumer object into three methods of constructor, instantiation (init) and cleaning (destroy). More specifically, the message consumer object group name and the NameServer address are used as attributes and provided by a Spring container during configuration; the loading unit 4 instantiates the message consumer object, sets a NameServer address and initializes the message consumer object; clearing resources upon destruction of the message consumer object.
In the embodiment, the message subscription component performs unified management on the Consumer list; and the message subscription granularity of the Consumer is refined to a tag level. The method can subscribe different tags under the same topic for multiple times without violating a RockettMQ (Message Queue) and subscribing different tags under a certain topic for multiple times, and the Message Queue can cover the problem of the former and facilitate the identification of service logic. Thus, the message pushing and receiving process is simplified, and the learning cost of developers using the RockettMQ is minimized. And the message subscription granularity of the Consumer is refined to tag level, developers can realize the Consumer of the LyramqConsumer interface according to the service logic definition, and the Consumers can be different topoics and tags and can also be different tags under the same topoic, so that the message subscription mode is more flexible, and the processing and the distinguishing of the service logic are convenient.
In a preferred embodiment of the present embodiment, before the adapting unit 1 adapts the subscription rules and the message filtering rules in the message consumer list, the message subscribing component performs unified management on the message producer. The loading unit 4 divides the life cycle of the message producer object into three methods of constructor, instantiation (init) and cleaning (destroy). The method specifically comprises the following steps: the loading unit 4 takes the message producer object group name and the NameServer address as attributes, and a Spring container provides the attributes during configuration; instantiating the message producer object, setting a NameServer address, and initializing the message producer object; clearing resources when the message producer object is destroyed. And the main method send of message sending completes the unified conversion of the data format of the message entity and the message sending.
The message subscription component of the embodiment is based on a conventional Spring framework in a manner of integrating RocktMQ, abstracts the implementation manners of original message producers and message consumers, uniformly manages the initialization and configuration of message producer and message Consumer objects, defines and binds the message listener objects, cleans resources, closes network connection and the like, and meanwhile, refines the granularity of message subscription to a tag level.
Example three:
based on the second embodiment, the present invention further provides a message subscription system, where the mobile terminal includes the message subscription component based on the rocktmq as described in the second embodiment, and the specific structure and the working principle of the message subscription component may refer to the description of the second embodiment, and are not described herein again.
In the embodiment of the invention, the message subscription granularity of the message consumer is thinned to the message identification level, so that when a new service purpose is generated, only one message consumer needs to be newly added, and the service risk brought by the implementation of change is reduced.
Example four:
fig. 9 is a structural diagram of a message subscription component based on a rockmq according to a fourth embodiment of the present invention, where the message subscription component includes: a memory (memory)51, a processor (processor)52 and a bus 53, wherein the processor 52 and the memory 51 are communicated with each other via the bus 53.
A memory 51 for storing various data;
in particular, the memory 51 is used for storing various data, such as, but not limited to, messages, message producers, message consumers, subscription rules, message filtering rules, and the like, and includes a plurality of computer programs.
A processor 52, configured to call various computer programs in the memory 51 to execute a message subscription method based on a rockmq provided in the first embodiment, for example:
adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification;
corresponding consuming logic is executed.
In the embodiment, the message subscription granularity of the message consumer is refined to the message identification level, so that when a new service purpose is generated, only one new message consumer needs to be added, and the service risk brought by the implementation of change is reduced.
The invention also provides a memory, which stores a plurality of computer programs, and the computer programs are called by the processor to execute the message subscription method based on the rockmq in the first embodiment.
In the invention, the message subscription granularity of the message consumer is thinned to the message identification level, so that when a new service purpose is generated, only one message consumer needs to be newly added, and the service risk brought by the change implementation is reduced.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation.
Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A message subscription method based on RocktMQ is characterized by comprising the following steps:
adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification;
corresponding consuming logic is executed.
2. The message subscription method according to claim 1, wherein a plurality of said messages are included under the same message topic to identify different said message consumers.
3. The method of claim 1, wherein the adapting the subscription rules and the message filtering rules in the message consumer list comprises:
merging the message consumers with the same message subject and the same message identification;
and automatically subscribing all messages under the message topic when the message identification is not specified.
4. The message subscription method according to claim 1, wherein before adapting the subscription rules and the message filtering rules in the message consumer list, the method comprises:
automatically loading the message consumer implementing a message consumption interface class into the message consumer list;
and completing the creation of the message consumer by unified management.
5. The message subscription method according to claim 1, wherein before adapting the subscription rules and the message filtering rules in the message consumer list, the method comprises:
the method is characterized in that the message producer is managed uniformly, the life cycle of the message producer object is divided into three methods, namely, a construction function, instantiation and cleaning.
6. The message subscription method according to claim 5, wherein said dividing the life cycle of the message producer object into three methods of constructor, instantiation and cleaning comprises:
the message producer object group name and the NameServer address are used as attributes and provided by a Spring container during configuration;
instantiating the message producer object, setting a NameServer address, and initializing the message producer object;
clearing resources when the message producer object is destroyed.
7. A message subscription component based on rockmq, comprising:
the adaptive unit is used for adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
the searching unit is used for polling the message consumer list and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification when receiving the message notification;
and the execution unit is used for executing corresponding consumption logic.
8. A message subscription system based on rockmq, characterized in that it comprises a message subscription component according to claim 7.
9. A memory storing a computer program, the computer program being executable by a processor to perform the steps of:
adapting a subscription rule and a message filtering rule in a message consumer list, wherein the subscription rule and the message filtering rule are related to a message theme and a message identifier;
when a message notification is received, polling the message consumer list, and searching the message consumers corresponding to the subscription rule and the message filtering rule in the message notification;
corresponding consuming logic is executed.
10. A message subscription component comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the rockmq-based message subscription method according to any one of claims 1 to 6 when executing the computer program.
CN201811136394.8A 2018-09-27 2018-09-27 Message subscription method and component based on RocktMQ and message subscription system Active CN110956485B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811136394.8A CN110956485B (en) 2018-09-27 2018-09-27 Message subscription method and component based on RocktMQ and message subscription system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811136394.8A CN110956485B (en) 2018-09-27 2018-09-27 Message subscription method and component based on RocktMQ and message subscription system

Publications (2)

Publication Number Publication Date
CN110956485A true CN110956485A (en) 2020-04-03
CN110956485B CN110956485B (en) 2022-11-25

Family

ID=69975285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811136394.8A Active CN110956485B (en) 2018-09-27 2018-09-27 Message subscription method and component based on RocktMQ and message subscription system

Country Status (1)

Country Link
CN (1) CN110956485B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866072A (en) * 2020-06-10 2020-10-30 烽火通信科技股份有限公司 Message filter expansion method, application system and application method
CN112769924A (en) * 2020-12-31 2021-05-07 平安科技(深圳)有限公司 Distributed deployment method, device, equipment and medium of RocktMQ
CN113645576A (en) * 2021-08-20 2021-11-12 苏州良医汇网络科技有限公司 Unified message method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105323743A (en) * 2014-07-14 2016-02-10 中兴通讯股份有限公司 Method and device for subscribing to resource change notices
CN105827706A (en) * 2016-03-24 2016-08-03 努比亚技术有限公司 Information push device and method
US20170244798A1 (en) * 2016-02-18 2017-08-24 International Business Machines Corporation Managing push notifications on portable devices
CN107734047A (en) * 2017-10-27 2018-02-23 中航信移动科技有限公司 Information push method and device
CN108306941A (en) * 2018-01-05 2018-07-20 上海你我贷互联网金融信息服务有限公司 A kind of distributed information system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105323743A (en) * 2014-07-14 2016-02-10 中兴通讯股份有限公司 Method and device for subscribing to resource change notices
US20170244798A1 (en) * 2016-02-18 2017-08-24 International Business Machines Corporation Managing push notifications on portable devices
CN105827706A (en) * 2016-03-24 2016-08-03 努比亚技术有限公司 Information push device and method
CN107734047A (en) * 2017-10-27 2018-02-23 中航信移动科技有限公司 Information push method and device
CN108306941A (en) * 2018-01-05 2018-07-20 上海你我贷互联网金融信息服务有限公司 A kind of distributed information system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866072A (en) * 2020-06-10 2020-10-30 烽火通信科技股份有限公司 Message filter expansion method, application system and application method
CN112769924A (en) * 2020-12-31 2021-05-07 平安科技(深圳)有限公司 Distributed deployment method, device, equipment and medium of RocktMQ
CN112769924B (en) * 2020-12-31 2022-04-15 平安科技(深圳)有限公司 Distributed deployment method, device, equipment and medium of RocktMQ
CN113645576A (en) * 2021-08-20 2021-11-12 苏州良医汇网络科技有限公司 Unified message method and system
CN113645576B (en) * 2021-08-20 2023-03-24 苏州良医汇网络科技有限公司 Unified message method and system

Also Published As

Publication number Publication date
CN110956485B (en) 2022-11-25

Similar Documents

Publication Publication Date Title
CN110956485B (en) Message subscription method and component based on RocktMQ and message subscription system
CN111221630B (en) Business process processing method, device, equipment, readable storage medium and system
CN103186834A (en) Method and device of business process configuration
CN111708619B (en) Distributed transaction processing method and system based on message queue and database
CN108279882B (en) Framework generation method, device, equipment and computer readable medium
CN113867600A (en) Development method and device for processing streaming data and computer equipment
CN110457132B (en) Method and device for creating functional object and terminal equipment
CN110781180A (en) Data screening method and data screening device
CN112187890A (en) Information distribution method based on cloud computing and big data and block chain financial cloud center
CN114128236B (en) Cloud service method, device and medium
CN113127775B (en) Page loading method, device, equipment and storage medium
CN113743879A (en) Automatic rule processing method, system and related equipment
CN114640610B (en) Cloud-protogenesis-based service management method and device and storage medium
CN111756836B (en) Information sending method and device based on event management model
CN113326172B (en) Operation and maintenance knowledge processing method, device and equipment
CN112416980B (en) Data service processing method, device and equipment
CN108874625B (en) Information processing method and device, electronic equipment and storage medium
CN114567559A (en) Training method and device of data analysis model and storage medium
CN113965900B (en) Method, device, computing equipment and storage medium for dynamically expanding flow resources
CN112799797A (en) Task management method and device
US20230110520A1 (en) Ui service package generation and registration method and apparatus, and ui service loading method and apparatus
CN117112550B (en) Data cleaning method, data cleaning device, computer device and storage medium
US9436523B1 (en) Holistic non-invasive evaluation of an asynchronous distributed software process
CN117527880B (en) Message management method, device, electronic equipment and computer readable storage medium
CN114866605B (en) Network change proxy method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 200438 9 / F, 10 / F, 11 / F, 12 / F, 38 Lane 1688, Guoquan North Road, Yangpu District, Shanghai

Applicant after: QIANXUN SPATIAL INTELLIGENCE Inc.

Address before: Room j165, 1st floor, building 64, 1436 Jungong Road, Yangpu District, Shanghai, 200433

Applicant before: QIANXUN SPATIAL INTELLIGENCE Inc.

GR01 Patent grant
GR01 Patent grant