CN113986601A - Consumption information query method and device, storage medium and electronic equipment - Google Patents

Consumption information query method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113986601A
CN113986601A CN202111608271.1A CN202111608271A CN113986601A CN 113986601 A CN113986601 A CN 113986601A CN 202111608271 A CN202111608271 A CN 202111608271A CN 113986601 A CN113986601 A CN 113986601A
Authority
CN
China
Prior art keywords
consumption
information
message
abnormal
consumption information
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
CN202111608271.1A
Other languages
Chinese (zh)
Other versions
CN113986601B (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.)
Feihu Information Technology Tianjin Co Ltd
Original Assignee
Feihu Information Technology Tianjin Co Ltd
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 Feihu Information Technology Tianjin Co Ltd filed Critical Feihu Information Technology Tianjin Co Ltd
Priority to CN202111608271.1A priority Critical patent/CN113986601B/en
Publication of CN113986601A publication Critical patent/CN113986601A/en
Application granted granted Critical
Publication of CN113986601B publication Critical patent/CN113986601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0787Storage of error reports, e.g. persistent data storage, storage using memory protection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a consumption information query method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when a message middleware of a service system receives an information query request of an operation and maintenance platform, sending an information acquisition request to a corresponding consumption end, and receiving current consumption information and abnormal consumption information which are determined by the consumption end in response to the information acquisition request, wherein the current consumption information comprises a process consumption record corresponding to each message which is consumed at the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each message which is consumed abnormally and stored at the consumption end; and sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information. By applying the method of the invention, the user can conveniently and quickly acquire the consumption information of the consumption end to locate the abnormal reason, and does not need to manually search abnormal data on the server, thereby reducing the workload and improving the efficiency.

Description

Consumption information query method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a consumption information query method and apparatus, a storage medium, and an electronic device.
Background
In the existing system architecture, message middleware is one of the commonly used components, and usually a production end produces a message to the message middleware, and a consumption end acquires the message from the message middleware for consumption.
In the actual message consumption process, some abnormal situations affecting the business process often occur, for example, consumption accumulation that a large number of messages cannot be consumed in time is generated, or consumption abnormality that a consumption end cannot successfully consume messages due to business abnormality or network jitter and the like. At this time, the operation and maintenance personnel need to locate the reason of the abnormal situation.
Currently, operation and maintenance personnel usually check an operation log or check data information in a thread stack on a server to perform exception positioning. The data volume on the server is very large, the workload of manually searching abnormal data is large, the positioning difficulty is also high, a large amount of time is consumed, and the efficiency of positioning the abnormal data is low.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a consumption information query method, so as to solve the problems of large workload, long time consumption and low work efficiency in manually searching abnormal data.
The embodiment of the invention also provides a consumption information inquiry device which is used for ensuring the actual realization and application of the method.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a consumption information query method, comprising:
when a message middleware of a service system receives an information query request, sending an information acquisition request to a consumption end corresponding to the information query request, wherein the information query request is a request sent by an operation and maintenance platform in response to a query operation of a user on the consumption end;
receiving current consumption information and abnormal consumption information which are determined by the consumption end in response to the information acquisition request, wherein the current consumption information comprises a process consumption record corresponding to each consumed message stored by the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each consumed abnormal message stored by the consumption end;
and sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information.
Optionally, the sending the information obtaining request to the consuming side corresponding to the information query request includes:
and calling a preset remote request instruction in a communication module of the message middleware, and sending the information acquisition request to the consumption end based on the remote request instruction.
Optionally, the method includes that the process of storing the process consumption record corresponding to the message being consumed by the consuming terminal includes:
when the consumption end needs to consume and process target messages in all messages to be consumed, target consumption information corresponding to the target messages is determined, and the target consumption information comprises message identifications, consumption threads and consumption time corresponding to the target messages;
and performing consumption processing on the target message, and storing the target consumption message as a process consumption record corresponding to the target message in the process of performing consumption processing on the target message.
Optionally, the method includes that the process of storing, by the consuming side, the abnormal consumption record corresponding to the abnormal consumption message includes:
after the consumption processing process of the target message is finished, judging whether the consumption end successfully consumes the target message;
if the target message is not successfully consumed by the consumption end, determining abnormal information corresponding to the target message, wherein the abnormal information comprises the message identifier, the consumption thread, the consumption time and a stack identifier corresponding to the target message;
and determining the target message as a message with abnormal consumption, and storing the abnormal information as an abnormal consumption record corresponding to the target message.
The above method, optionally, further includes:
and deleting the stored process consumption record corresponding to the target message after the consumption processing process of the target message is finished.
Optionally, in the method described above, the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information, and the method includes:
responding to the operation of inquiring the thread state of the consumption end by the user, and determining each thread which is consuming the message currently based on the current consumption information;
determining thread information corresponding to each thread, wherein each thread information comprises stack information, thread state, consumption starting time and a message identification list of the corresponding thread;
and displaying the thread information in a front-end interface of the operation and maintenance platform.
Optionally, in the method described above, the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information, and the method includes:
responding to the operation of inquiring the abnormal state of the consumption end by the user, and determining each abnormal stack corresponding to the consumption end based on the abnormal consumption information;
determining stack exception information corresponding to each exception stack, wherein each stack exception information comprises stack information, exception time and an exception message identification list of the corresponding exception stack;
and displaying each stack abnormal information in a front-end interface of the operation and maintenance platform.
A consumption information query apparatus, comprising:
the system comprises a first sending unit, a second sending unit and a service system, wherein the first sending unit is used for sending an information acquisition request to a consumption end corresponding to an information query request when the information middleware of the service system receives the information query request, and the information query request is a request sent by an operation and maintenance platform in response to a query operation of a user on the consumption end;
a receiving unit, configured to receive current consumption information and abnormal consumption information, which are determined by the consuming terminal in response to the information acquisition request, where the current consumption information includes a process consumption record corresponding to each message being consumed and stored by the consuming terminal, and the abnormal consumption information includes an abnormal consumption record corresponding to each message being consumed and abnormal and stored by the consuming terminal;
and the second sending unit is used for sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information.
A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium is located to perform the consumption information query method as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform a method of consumer information query as described above.
Based on the above-mentioned consumption information query method provided by the embodiment of the present invention, the method includes: when a message middleware of a service system receives an information query request sent by a user through an operation and maintenance platform, an information acquisition request is sent to a corresponding consumption end, and current consumption information and abnormal consumption information determined by the consumption end are received, wherein the current consumption information comprises a process consumption record corresponding to each message which is consumed at the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each message which is consumed abnormally and stored at the consumption end. And sending the current consumption information and the abnormal consumption information to an operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to a user based on the current consumption information and the abnormal consumption information. By applying the method provided by the embodiment of the invention, operation and maintenance personnel can inquire the consumption information of the consumption end through the operation and maintenance platform, can remotely acquire the consumption information corresponding to the message being consumed by the consumption end and the consumption information corresponding to the message with abnormal consumption in real time, can conveniently and quickly acquire the consumption information, and can quickly locate the abnormal reason without manually searching abnormal data in a large amount of data on the server by the operation and maintenance personnel, so that the workload of the operation and maintenance personnel can be saved, the time consumption in the abnormal location process can be reduced, and the efficiency can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for querying consumption information according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a consumption information query method according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a request flow in a consumption information query method according to an embodiment of the present invention;
fig. 4 is a flowchart of another method of a consumption information query method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a consumption information query device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
As known from the background art, when a consumer encounters a condition of consumption accumulation or consumption abnormality, the normal business process is affected. If the problem needs to be solved, the reason of accumulation or abnormality needs to be located first, and the reason of the problem needs to be located, so that operation and maintenance personnel often need to check logs or thread stacks on a server, the locating difficulty is high, and a large amount of time needs to be consumed.
Therefore, the embodiment of the invention provides a consumption information query method, which is characterized in that consumption information pre-stored in a consumption end is obtained through a message middleware and fed back to a user, the user can remotely query the consumption information of the consumption end, the user can favorably position abnormal data of the consumption end, the workload of the user is reduced, and the efficiency is improved.
An embodiment of the present invention provides a consumption information query method, where the method is applicable to a message middleware of a service system, and an execution subject of the method may be a processor of the message middleware, and a flow chart of the method is shown in fig. 1, where the method includes:
s101: when a message middleware of a service system receives an information query request, sending an information acquisition request to a consumption end corresponding to the information query request, wherein the information query request is a request sent by an operation and maintenance platform in response to a query operation of a user on the consumption end;
in the method provided by the embodiment of the invention, a user can inquire the consumption information of a certain consumption end through the front end of the operation and maintenance platform. The operation and maintenance platform can communicate with the message middleware of the service system where the consumption end is located, and the operation and maintenance platform can respond to the query operation of the user and send an information query request to the message middleware. And when the message middleware receives the request, the message middleware sends an information acquisition request to the corresponding consumption end.
The message middleware in the method provided by the embodiment of the invention can be distributed message middleware, such as a RockettMQ distributed message middleware of an open source of Alibab. The operation and maintenance platform can be a service platform aiming at message middleware, such as a RocktMQ monitoring operation and maintenance platform MQCloud of a search fox open source.
It should be noted that the service system in the method provided by the embodiment of the present invention refers to a system architecture, which may include a plurality of consumption terminals deployed in a distributed manner, a plurality of production terminals deployed in a distributed manner, and a distributed message middleware, where messages produced by each production terminal are pushed to the message middleware, and each consumption terminal acquires messages from the message middleware for consumption, and each consumption terminal and each production terminal may also be a specific system. The query process provided by the embodiment of the invention is a process of querying a certain consumption end in the service system, and in a specific application process, a user can query any consumption end in the service system.
S102: receiving current consumption information and abnormal consumption information which are determined by the consumption end in response to the information acquisition request, wherein the current consumption information comprises a process consumption record corresponding to each consumed message stored by the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each consumed abnormal message stored by the consumption end;
in the method provided by the embodiment of the invention, when the consumption end receives the information acquisition request sent by the message middleware, the current consumption information and the abnormal consumption information corresponding to the consumption end can be determined according to the consumption record stored in advance, and the current consumption information and the abnormal consumption information are sent to the message middleware.
In the method provided by the embodiment of the present invention, the consuming end may perform data statistics on the consumed messages in a Software Development Kit (SDK) embedded manner, store a process consumption record of each consumed message, and may include thread information for consuming the message, and the like. For each message consuming exception, its corresponding exception consumption record is also recorded, which may include thread information and stack information for consuming the message, etc. The process consumption record and the abnormal consumption record may be stored in a memory of a Java Virtual Machine (JVM) on the consuming side.
S103: and sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information.
In the method provided by the embodiment of the invention, after the message middleware receives the current consumption information and the abnormal consumption information sent by the consumption end, the current consumption information and the abnormal consumption information can be sent to the operation and maintenance platform, and the operation and maintenance platform can feed back the consumption information corresponding to the consumption end to the user according to a preset data display strategy based on the current consumption information and the abnormal consumption information.
Based on the method provided by the embodiment of the invention, when the message middleware of a service system receives an information query request sent by an operation and maintenance platform, an information acquisition request is sent to a corresponding consumption end, and current consumption information and abnormal consumption information determined by the consumption end are received, wherein the current consumption information comprises a process consumption record corresponding to each message which is consumed at the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each message which is consumed abnormally and stored at the consumption end; and sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information. By applying the method provided by the embodiment of the invention, the user can obtain the related information of the message consumed by the consumption end and the message with abnormal consumption by inquiring through the operation and maintenance platform. When the consumption end has abnormal conditions, the operation and maintenance personnel can conveniently and quickly acquire the related consumption information of the consumption end to quickly locate the abnormal reasons, and the abnormal data does not need to be manually searched in a large amount of data of the server, so that the workload of the operation and maintenance personnel can be saved, the time consumption of the abnormal location work is reduced, and the work efficiency is improved.
In order to better explain the method provided by the embodiment of the present invention, the query process in the method provided by the embodiment of the present invention is further explained with reference to fig. 2.
As shown in fig. 2, the objects involved in the query process include the operation and maintenance platform MQCloud, the message middleware rockmq and the consumer (consumer end). In the operation process of the service system, the consumer acquires the message from the RockketMQ for consumption. By means of the embedded SDK, the consumer records relevant information in the message consumption process, including process consumption records of each message being consumed and abnormal consumption records of each message with abnormal consumption.
The query process provided by the embodiment of the invention is as follows:
1. querying data;
the user can perform an operation of querying the consumption detail information of the consumer through a front-end interface (which may be a web interface) of the MQCloud, so that the front-end interface sends a query instruction for querying the consumption information of the consumer to the MQCloud. The specific operation may be to click on the name identifier of a certain consumer in the monitoring interface of the consumption details.
2. Acquiring the status of a consumer;
the MQCloud sends an information query request to the rockmq requesting to obtain the status of the consumer (i.e., its relevant consumption information) in response to a query operation of the user at the front-end interface.
3. A remote request;
and the RocktMQ responds to the information query request of the MQCloud, and sends a remote request to the consumer to request to acquire the related information in the message consumption process.
4. Returning the data;
the consumer returns the data requested by the RocketMQ to the RocketMQ.
5. Returning to the consumer status;
and when the RocktMQ receives the data returned by the consumer, returning the related consumption information corresponding to the consumer condition to the MQCloud.
6. Returning the data;
and when the MQCloud receives the related consumption information of the consumer condition returned by the RocktMQ, returning the related consumption information of the consumer to the front-end interface so as to feed back the related consumption information to the user.
Further, on the basis of the method shown in fig. 1, an embodiment of the present invention provides another consumption information query method, in the method provided in the embodiment of the present invention, a process of sending an information acquisition request to a consumption end corresponding to the information query request in step S101 includes:
and calling a preset remote request instruction in a communication module of the message middleware, and sending the information acquisition request to the consumption end based on the remote request instruction.
In the method provided by the embodiment of the invention, a communication module (an internal communication protocol or a communication processor) of the message middleware can be expanded in advance, and an instruction supporting the inquiry of the consumption information of the consumption end is added. The corresponding information acquisition request can be sent to the consumption end based on the remote request instruction by calling the preset remote request instruction.
The message middleware in the method provided by the embodiment of the invention is the RocktMQ, and the communication part of the RocktMQ is expanded, so that the RocktMQ can support the consumption condition of the query consumption end. The communication support method is specifically realized by expanding a Netty communication processor of the RocktMQ, adding an instruction for supporting the consumption state query of a consumption end, and realizing the communication support under the condition of not modifying a RocktMQ core source code. The instruction configuration and transmission process in the query process can be as shown in fig. 3, where an instruction of the sourceclientremoting processor (i.e., the processor of mq) is sent to the clientremoting processor (i.e., the processor of rocktmq), and the instruction is sent to the corresponding consumer through the processing of the netyrequest processor (i.e., the processor of rocktmq) in the rocktmq. It should be noted that the specific instruction content and object name shown in fig. 3 are only for better describing the specific embodiment provided by the method provided by the embodiment of the present invention, and are not limitations on the specific setting content.
To better explain the method provided by the embodiment of the present invention, on the basis of the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process of storing, by the consuming end, the process consumption record corresponding to the message being consumed in step S102 includes:
when the consumption end needs to consume and process target messages in all messages to be consumed, target consumption information corresponding to the target messages is determined, and the target consumption information comprises message identifications, consumption threads and consumption time corresponding to the target messages;
in the method provided by the embodiment of the invention, the consumption end can process all the messages to be consumed in parallel in sequence. According to the consumption sequence, when the consumption end needs to consume and process the target message, the message identifier of the target message and the consumption thread consuming the target message can be determined according to the message information and the thread distribution information of the target message, the current time (consumption starting time) is taken as the consumption time corresponding to the target message, and the information is taken as the corresponding target consumption information.
And performing consumption processing on the target message, and storing the target consumption message as a process consumption record corresponding to the target message in the process of performing consumption processing on the target message.
In the method provided by the embodiment of the invention, the target message can be consumed according to the consumption logic of the target message, and when the target message starts the actual consumption processing process, the target message is taken as the message of the current message, and the corresponding target consumption information is taken as the corresponding process consumption record to be stored.
It should be noted that, in the embodiment of the present invention, only the storage process of the process consumption record corresponding to one message being consumed is described, and in an actual application process, the consuming end executes the storage process for each message being consumed when starting an actual consumption processing process of the message.
Further, on the basis of the method provided by the foregoing embodiment, in the method provided by the embodiment of the present invention, the process of storing, by the consuming side, the abnormal consumption record corresponding to the abnormal consumption message in step S102 includes:
after the consumption processing process of the target message is finished, judging whether the consumption end successfully consumes the target message;
in the method provided by the embodiment of the invention, after the consumption processing process of the target message is finished, the consumption result corresponding to the target message can be obtained, whether the target message is successfully consumed by the consumption end is judged according to the consumption result, if the consumption result is successful, the target message is successfully consumed by the consumption end, and if the consumption result is failed, the target message is not successfully consumed by the consumption end.
If the target message is not successfully consumed by the consumption end, determining abnormal information corresponding to the target message, wherein the abnormal information comprises the message identifier, the consumption thread, the consumption time and a stack identifier corresponding to the target message;
in the method provided by the embodiment of the invention, if the consumption end does not successfully consume the target message, the message identifier of the target message, the consumption thread and the consumption time for consuming the message and the stack identifier corresponding to the stack where the target message is located are obtained according to the prestored process consumption record and the stack distribution information, and the information is used as the abnormal information corresponding to the target message.
And determining the target message as a message with abnormal consumption, and storing the abnormal information as an abnormal consumption record corresponding to the target message.
In the method provided by the embodiment of the invention, when the consumption of the target message fails, the target message is taken as a consumption abnormal message, and the corresponding abnormal information is taken as the corresponding abnormal consumption record to be stored.
It should be noted that, in the embodiment of the present invention, only the storage process of the abnormal consumption record corresponding to one message with abnormal consumption is described, in an actual application process, after the consumption processing process of each message is finished, the consumption end determines whether the message is consumed successfully, and for each message that is not consumed successfully, the storage process of the abnormal consumption record is executed.
Further, on the basis of the method provided by the above embodiment, the method provided by the embodiment of the present invention further includes:
and deleting the stored process consumption record corresponding to the target message after the consumption processing process of the target message is finished.
In the method provided by the embodiment of the invention, after the consumption processing process of the message being consumed is finished, the process consumption record of the message, which is stored when the consumption is started, can be deleted. That is, the process consumption records corresponding to each message being consumed stored in the consumption end are changed, and after the processing process of a certain message is finished, the message is no longer used as the message being consumed, and the corresponding process consumption record is also deleted.
In order to better explain the information storage process mentioned in the above embodiment, a brief description is further made of the data recording and storage process of the consuming terminal in the message consuming process in the method provided by the embodiment of the present invention with reference to the flowchart shown in fig. 4.
As shown in fig. 4, before the consuming side needs to consume a certain message, the process ConsumeThreadStat acquires a consuming thread, a message ID, and a consuming time (consuming start time), stores the information and the message in the JVM memory in correspondence, and stores the information and the message in a key- > value structure (key is a thread object, and value is a message list and consuming start time).
And processing the message through a real consumption logic, and judging whether the message is consumed successfully or not after the processing process is finished.
If the consumption fails, the process messageexceptinonmetric records the consumption thread, the consumption ID and the consumption time of the message, and the messageexceptinonmetric needs to determine the stack corresponding to the message, use the stack as an exception stack, and additionally record the exception stack in addition to the storage structure. The above information may also be stored in the JVM memory.
When the consumption processing procedure of the message is completed, whether the message is consumed successfully or consumed unsuccessfully, the process ConsumeThreadStat removes the previously recorded storage structure (the above consumption thread, consumption ID, and consumption time) of the message.
It should be noted that, the specific process name mentioned in the method provided by the embodiment of the present invention is only used to better describe a specific embodiment provided by the method provided by the embodiment of the present invention, and is not limited to an actual process name.
Based on the method provided by the embodiment of the invention, the condition information such as the thread stack (consumption thread), the abnormal stack, the corresponding message and the like of the consumption end can be collected in real time, the consumption information real-time transmission between the RockMQ and the consumption end is realized by expanding the inner communication protocol of the RockMQ, and the web display of the consumption information is realized by MQCloud, so that the real-time diagnosis of common problems such as consumption blockage, consumption abnormity and the like becomes feasible, the positioning of the problems of the blockage and the abnormity becomes convenient, and the time for manually carrying out fussy diagnosis when the service encounters the problems can be saved.
To better explain the method provided by the embodiment of the present invention, on the basis of the method provided by the above embodiment, the embodiment of the present invention provides another consumption information query method, wherein the process of feeding back the consumption information of the consuming end to the user by the operation and maintenance platform mentioned in step S103 based on the current consumption information and the abnormal consumption information includes:
responding to the operation of inquiring the thread state of the consumption end by the user, and determining each thread which is consuming the message currently based on the current consumption information;
in the method provided by the embodiment of the invention, the front-end interface of the MQCloud can provide a query interface of the consumption details, when a user clicks a query button corresponding to the consumption end in the query interface of the consumption details, the consumption end can be queried, and the MQCloud can trigger the query process provided by the embodiment to obtain the current consumption information and the abnormal consumption information corresponding to the consumption end. After a user queries a consumption end, the user can jump to a consumption detail page corresponding to the consumption end, and the consumption detail interface can display brief consumption condition statistical information, including statistical conditions of a deceased queue (a queue storing messages with retry times reaching a threshold), such as queue identification, minimum offset, maximum offset, message amount and update time. The statistics also include statistics of the retry queue, such as client IP, broker identification, queue identification, broker offset, consumer offset, heap amount, and last consumed time. The statistical information also includes statistical information of normal consumption queues, such as client IP, broker id, queue id, broker offset, consumer offset, amount of stock and latest consumption time.
In the display column of the statistical information of the normal consumption queue, a corresponding thread state query button can be displayed, and a user can query the thread state of the consumer end by clicking the button. In response to this operation, the MQCloud may determine, based on the current consumption information corresponding to the consuming side, the respective threads that the consuming side is currently consuming the message.
Determining thread information corresponding to each thread, wherein each thread information comprises stack information, thread state, consumption starting time and a message identification list of the corresponding thread;
in the method provided by the embodiment of the invention, the stack information, the thread state, the consumption starting time and the message identification list of each thread can be determined according to the content contained in the current consumption information, and the message identification list contains the message identification (message ID) of each message consumed by the corresponding thread.
And displaying the thread information in a front-end interface of the operation and maintenance platform.
In the method provided by the embodiment of the present invention, the stack information of each thread at the consuming side, that is, the data content in the thread stack corresponding to the consuming side, can be displayed in the front-end interface, and the thread state corresponding to the thread, such as time _ wait, running, BLOCKED, or WAITING, is displayed at the same time. In addition, a message identifier list corresponding to each thread is displayed at the same time, and when the user clicks the message identifier in the message identifier list, the message content corresponding to the clicked message identifier is displayed to the user, wherein the message content comprises the client IP, the sending time, the browser, the queue identifier and the message details.
Based on the method provided by the embodiment of the invention, a user can inquire the thread stack, the thread state and the consumption starting time of the message consumed by the consumption end in the front-end interface, determine whether the thread is blocked according to the information, position the blocked thread and the blocked time, and further track the service code. When a user needs to inquire what message causes blocking, the user can also obtain the message content by clicking the message identifier in the message identifier list, so that the user can be assisted to carry out deeper tracking work, and the working efficiency is improved.
Further, on the basis of the method provided by the above embodiment, in the method provided by the embodiment of the present invention, the process of feeding back the consumption information of the consuming end to the user by the operation and maintenance platform mentioned in step S103 based on the current consumption information and the abnormal consumption information includes:
responding to the operation of inquiring the abnormal state of the consumption end by the user, and determining each abnormal stack corresponding to the consumption end based on the abnormal consumption information;
in the method provided by the embodiment of the invention, in the consumption detail page corresponding to the consumption end, the corresponding abnormal state query button can be displayed in the display column of the statistical information of the normal consumption queue, and the user can query the related information of the abnormal state of the consumption end by clicking the button. In response to this operation, the MQCloud may determine each exception stack, i.e., the stack to which each message of the consumption exception corresponds, based on the exception consumption information corresponding to the consuming side.
Determining stack exception information corresponding to each exception stack, wherein each stack exception information comprises stack information, exception time and an exception message identification list of the corresponding exception stack;
in the method provided by the embodiment of the invention, the stack information, the abnormal time and the abnormal message identification list corresponding to each abnormal stack can be determined according to the content contained in the abnormal consumption information, and the abnormal message identification list contains the message identification (message ID) of each abnormal consumption message corresponding to the abnormal stack.
And displaying each stack abnormal information in a front-end interface of the operation and maintenance platform.
In the method provided by the embodiment of the invention, the stack information, the abnormal time and the abnormal message identifier list of each abnormal stack can be displayed in the front-end interface, and when a user clicks the message identifier in the abnormal message identifier list, the message content corresponding to the message identifier clicked by the user can be displayed.
Corresponding to the consumption information query method shown in fig. 1, an embodiment of the present invention further provides a consumption information query apparatus, which is used for implementing the method shown in fig. 1 specifically, and a schematic structural diagram of the apparatus is shown in fig. 5, where the apparatus includes:
a first sending unit 201, configured to send an information obtaining request to a consuming end corresponding to an information query request when an information middleware of a service system receives the information query request, where the information query request is a request sent by an operation and maintenance platform in response to a query operation of a user on the consuming end;
a receiving unit 202, configured to receive current consumption information and abnormal consumption information, which are determined by the consuming terminal in response to the information obtaining request, where the current consumption information includes a process consumption record corresponding to each message being consumed and stored by the consuming terminal, and the abnormal consumption information includes an abnormal consumption record corresponding to each message being consumed and stored by the consuming terminal;
the second sending unit 203 is configured to send the current consumption information and the abnormal consumption information to the operation and maintenance platform, so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information.
Based on the device provided by the embodiment of the invention, when the message middleware of a service system receives an information query request sent by an operation and maintenance platform, an information acquisition request is sent to a corresponding consumption end, and current consumption information and abnormal consumption information determined by the consumption end are received, wherein the current consumption information comprises a process consumption record corresponding to each message which is consumed at the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each message which is consumed abnormally and stored at the consumption end; and sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information. By applying the device provided by the embodiment of the invention, a user can obtain the related information of the message consumed by the consumption end and the message with abnormal consumption by inquiring through the operation and maintenance platform. When the consumption end has abnormal conditions, the operation and maintenance personnel can conveniently and quickly acquire the related consumption information of the consumption end to quickly locate the abnormal reasons, and the abnormal data does not need to be manually searched in a large amount of data of the server, so that the workload of the operation and maintenance personnel can be saved, the time consumption of the abnormal location work is reduced, and the work efficiency is improved.
On the basis of the apparatus provided in the foregoing embodiment, in the apparatus provided in the embodiment of the present invention, the first sending unit 201 includes:
and the calling subunit is used for calling a preset remote request instruction in a communication module of the message middleware and sending the information acquisition request to the consumption end based on the remote request instruction.
On the basis of the device provided by the above embodiment, the device provided by the embodiment of the present invention further includes:
the first determining unit is used for determining target consumption information corresponding to a target message when the consumption end needs to consume and process the target message in each message to be consumed, wherein the target consumption information comprises a message identifier, a consumption thread and consumption time corresponding to the target message;
and the first storage unit is used for performing consumption processing on the target message and storing the target consumption message as a process consumption record corresponding to the target message in the process of performing consumption processing on the target message.
On the basis of the device provided by the above embodiment, the device provided by the embodiment of the present invention further includes:
the judging unit is used for judging whether the consumption end successfully consumes the target message or not after the consumption processing process of the target message is finished;
a second determining unit, configured to determine, if the consuming end does not successfully consume the target message, exception information corresponding to the target message, where the exception information includes the message identifier, the consuming thread, the consuming time, and a stack identifier corresponding to the target message;
and the second storage unit is used for determining the target message as a message with abnormal consumption and storing the abnormal information as an abnormal consumption record corresponding to the target message.
On the basis of the device provided by the above embodiment, the device provided by the embodiment of the present invention further includes:
and the deleting unit is used for deleting the stored process consumption record corresponding to the target message after the consumption processing process of the target message is finished.
On the basis of the device provided by the above embodiment, the device provided by the embodiment of the present invention further includes:
a third determining unit, configured to determine, based on the current consumption information, each thread that is currently consuming a message in response to an operation of querying a thread state of the consuming end by the user;
a fourth determining unit, configured to determine thread information corresponding to each thread, where each thread information includes stack information, thread state, consumption start time, and a message identifier list of the thread corresponding to the thread;
and the first display unit is used for displaying the thread information in a front-end interface of the operation and maintenance platform.
On the basis of the device provided by the above embodiment, the device provided by the embodiment of the present invention further includes:
a fifth determining unit, configured to determine, based on the abnormal consumption information, each abnormal stack corresponding to the consuming side in response to an operation of querying an abnormal state of the consuming side by the user;
a sixth determining unit, configured to determine stack exception information corresponding to each exception stack, where each stack exception information includes stack information of the corresponding exception stack, an exception time, and an exception message identifier list;
and the second display unit is used for displaying each stack exception information in a front-end interface of the operation and maintenance platform.
The embodiment of the present invention further provides a storage medium, where the storage medium includes stored instructions, and when the instructions are executed, the device where the storage medium is located is controlled to execute the consumption information query method as described above.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 6, which specifically includes a memory 301 and one or more instructions 302, where the one or more instructions 302 are stored in the memory 301 and configured to be executed by one or more processors 303 to perform the following operations of the one or more instructions 302:
when a message middleware of a service system receives an information query request, sending an information acquisition request to a consumption end corresponding to the information query request, wherein the information query request is a request sent by an operation and maintenance platform in response to a query operation of a user on the consumption end;
receiving current consumption information and abnormal consumption information which are determined by the consumption end in response to the information acquisition request, wherein the current consumption information comprises a process consumption record corresponding to each consumed message stored by the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each consumed abnormal message stored by the consumption end;
and sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. 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 previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A consumption information query method, comprising:
when a message middleware of a service system receives an information query request, sending an information acquisition request to a consumption end corresponding to the information query request, wherein the information query request is a request sent by an operation and maintenance platform in response to a query operation of a user on the consumption end;
receiving current consumption information and abnormal consumption information which are determined by the consumption end in response to the information acquisition request, wherein the current consumption information comprises a process consumption record corresponding to each consumed message stored by the consumption end, and the abnormal consumption information comprises an abnormal consumption record corresponding to each consumed abnormal message stored by the consumption end;
and sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information.
2. The method according to claim 1, wherein the sending an information obtaining request to a consuming side corresponding to the information query request includes:
and calling a preset remote request instruction in a communication module of the message middleware, and sending the information acquisition request to the consumption end based on the remote request instruction.
3. The method according to claim 1, wherein the process of storing the process consumption record corresponding to the message being consumed by the consuming end comprises:
when the consumption end needs to consume and process target messages in all messages to be consumed, target consumption information corresponding to the target messages is determined, and the target consumption information comprises message identifications, consumption threads and consumption time corresponding to the target messages;
and performing consumption processing on the target message, and storing the target consumption message as a process consumption record corresponding to the target message in the process of performing consumption processing on the target message.
4. The method according to claim 3, wherein the process of the consuming end storing the abnormal consumption record corresponding to the abnormal consumption message comprises:
after the consumption processing process of the target message is finished, judging whether the consumption end successfully consumes the target message;
if the target message is not successfully consumed by the consumption end, determining abnormal information corresponding to the target message, wherein the abnormal information comprises the message identifier, the consumption thread, the consumption time and a stack identifier corresponding to the target message;
and determining the target message as a message with abnormal consumption, and storing the abnormal information as an abnormal consumption record corresponding to the target message.
5. The method of claim 3, further comprising:
and deleting the stored process consumption record corresponding to the target message after the consumption processing process of the target message is finished.
6. The method of claim 1, wherein the operation and maintenance platform feeds back the consumption information of the consuming end to the user based on the current consumption information and the abnormal consumption information, and comprises:
responding to the operation of inquiring the thread state of the consumption end by the user, and determining each thread which is consuming the message currently based on the current consumption information;
determining thread information corresponding to each thread, wherein each thread information comprises stack information, thread state, consumption starting time and a message identification list of the corresponding thread;
and displaying the thread information in a front-end interface of the operation and maintenance platform.
7. The method of claim 1, wherein the operation and maintenance platform feeds back the consumption information of the consuming end to the user based on the current consumption information and the abnormal consumption information, and comprises:
responding to the operation of inquiring the abnormal state of the consumption end by the user, and determining each abnormal stack corresponding to the consumption end based on the abnormal consumption information;
determining stack exception information corresponding to each exception stack, wherein each stack exception information comprises stack information, exception time and an exception message identification list of the corresponding exception stack;
and displaying each stack abnormal information in a front-end interface of the operation and maintenance platform.
8. A consumption information inquiry apparatus, comprising:
the system comprises a first sending unit, a second sending unit and a service system, wherein the first sending unit is used for sending an information acquisition request to a consumption end corresponding to an information query request when the information middleware of the service system receives the information query request, and the information query request is a request sent by an operation and maintenance platform in response to a query operation of a user on the consumption end;
a receiving unit, configured to receive current consumption information and abnormal consumption information, which are determined by the consuming terminal in response to the information acquisition request, where the current consumption information includes a process consumption record corresponding to each message being consumed and stored by the consuming terminal, and the abnormal consumption information includes an abnormal consumption record corresponding to each message being consumed and abnormal and stored by the consuming terminal;
and the second sending unit is used for sending the current consumption information and the abnormal consumption information to the operation and maintenance platform so that the operation and maintenance platform feeds back the consumption information of the consumption end to the user based on the current consumption information and the abnormal consumption information.
9. A storage medium, comprising stored instructions, wherein when executed, the storage medium controls a device to execute the consumption information query method according to any one of claims 1 to 7.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the method of any one of claims 1-7.
CN202111608271.1A 2021-12-27 2021-12-27 Consumption information query method and device, storage medium and electronic equipment Active CN113986601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111608271.1A CN113986601B (en) 2021-12-27 2021-12-27 Consumption information query method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111608271.1A CN113986601B (en) 2021-12-27 2021-12-27 Consumption information query method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113986601A true CN113986601A (en) 2022-01-28
CN113986601B CN113986601B (en) 2022-04-26

Family

ID=79734460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111608271.1A Active CN113986601B (en) 2021-12-27 2021-12-27 Consumption information query method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113986601B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856393A (en) * 2013-07-09 2014-06-11 携程计算机技术(上海)有限公司 Distributed message-oriented middleware system based on database and operating method thereof
CN104092767A (en) * 2014-07-21 2014-10-08 北京邮电大学 Posting/subscribing system for adding message queue models and working method thereof
CN104731912A (en) * 2015-03-24 2015-06-24 浪潮集团有限公司 Message transmission method and device for message middleware MQ
CN110019001A (en) * 2017-08-17 2019-07-16 中国电信股份有限公司 Promote method, system and the monitoring module of message-oriented middleware message trace ability
CN110335034A (en) * 2019-06-27 2019-10-15 甘肃万华金慧科技股份有限公司 A kind of rate abnormality processing system
CN111240925A (en) * 2019-12-30 2020-06-05 昆明尚禾农业科技有限公司 Agricultural automation equipment monitoring operation and maintenance system
CN111381986A (en) * 2020-03-10 2020-07-07 北京奇艺世纪科技有限公司 Message transmission method, system, device, electronic equipment and readable storage medium
CN111611094A (en) * 2020-05-26 2020-09-01 山东汇贸电子口岸有限公司 Monitoring and managing method for abnormal MQ information
CN111915275A (en) * 2020-07-31 2020-11-10 上海燕汐软件信息科技有限公司 Application operation process management method, device and system
CN112185031A (en) * 2020-09-18 2021-01-05 广州市贺氏办公设备有限公司 Method, system, device and medium for processing abnormal data of consumer machine
CN112527520A (en) * 2020-12-01 2021-03-19 中国建设银行股份有限公司 Method and device for deploying message middleware
CN112583931A (en) * 2020-12-25 2021-03-30 北京百度网讯科技有限公司 Message processing method, message middleware, electronic device and storage medium
CN112689020A (en) * 2020-12-30 2021-04-20 北京锐安科技有限公司 Message transmission method, message middleware, electronic equipment and storage medium
CN112882842A (en) * 2021-02-03 2021-06-01 厦门投融汇网络有限公司 Data transmission method based on redis storage as message middleware
CN113746703A (en) * 2021-09-03 2021-12-03 上海众源网络有限公司 Abnormal link monitoring method, system and device

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856393A (en) * 2013-07-09 2014-06-11 携程计算机技术(上海)有限公司 Distributed message-oriented middleware system based on database and operating method thereof
CN104092767A (en) * 2014-07-21 2014-10-08 北京邮电大学 Posting/subscribing system for adding message queue models and working method thereof
CN104731912A (en) * 2015-03-24 2015-06-24 浪潮集团有限公司 Message transmission method and device for message middleware MQ
CN110019001A (en) * 2017-08-17 2019-07-16 中国电信股份有限公司 Promote method, system and the monitoring module of message-oriented middleware message trace ability
CN110335034A (en) * 2019-06-27 2019-10-15 甘肃万华金慧科技股份有限公司 A kind of rate abnormality processing system
CN111240925A (en) * 2019-12-30 2020-06-05 昆明尚禾农业科技有限公司 Agricultural automation equipment monitoring operation and maintenance system
CN111381986A (en) * 2020-03-10 2020-07-07 北京奇艺世纪科技有限公司 Message transmission method, system, device, electronic equipment and readable storage medium
CN111611094A (en) * 2020-05-26 2020-09-01 山东汇贸电子口岸有限公司 Monitoring and managing method for abnormal MQ information
CN111915275A (en) * 2020-07-31 2020-11-10 上海燕汐软件信息科技有限公司 Application operation process management method, device and system
CN112185031A (en) * 2020-09-18 2021-01-05 广州市贺氏办公设备有限公司 Method, system, device and medium for processing abnormal data of consumer machine
CN112527520A (en) * 2020-12-01 2021-03-19 中国建设银行股份有限公司 Method and device for deploying message middleware
CN112583931A (en) * 2020-12-25 2021-03-30 北京百度网讯科技有限公司 Message processing method, message middleware, electronic device and storage medium
CN112689020A (en) * 2020-12-30 2021-04-20 北京锐安科技有限公司 Message transmission method, message middleware, electronic equipment and storage medium
CN112882842A (en) * 2021-02-03 2021-06-01 厦门投融汇网络有限公司 Data transmission method based on redis storage as message middleware
CN113746703A (en) * 2021-09-03 2021-12-03 上海众源网络有限公司 Abnormal link monitoring method, system and device

Also Published As

Publication number Publication date
CN113986601B (en) 2022-04-26

Similar Documents

Publication Publication Date Title
US8195757B2 (en) Method, apparatus and computer program for controlling retention of publications
US7606808B2 (en) Maintaining and establishing subscriptions with load-balanced servers
CN111897638B (en) Distributed task scheduling method and system
CN102449628A (en) Architectural pattern for persistent web application design
CN112650606B (en) Message processing method, device, system, electronic equipment and storage medium
US7996840B2 (en) Method, system, and apparatus for scheduling pattern based web services
CN111818117A (en) Data updating method and device, storage medium and electronic equipment
CN111061498B (en) Configuration information management system
CN112055061A (en) Distributed message processing method and device
JP4905150B2 (en) Software operation result management system, method and program
US8326913B2 (en) Method and system for service contract discovery
CN112764696A (en) Cloud printing server, and intelligent printing method and system of remote printing equipment
CN112181627A (en) Timing task scheduling method, device and system
CN100479458C (en) Method, system, and apparatus for scheduling pattern based web services
US20090165011A1 (en) Resource management method, information processing system, information processing apparatus, and program
CN111310007A (en) Webpage interface query method and device, electronic equipment and storage medium
CN112398797B (en) Data transmission method, receiving device, transmitting device, medium, equipment and system
US7543041B2 (en) Pattern based web services using caching
US7289989B2 (en) Pattern based web services
CN113986601B (en) Consumption information query method and device, storage medium and electronic equipment
CN109905459B (en) Data transmission method and device
CN110505177B (en) Information collection system, terminal equipment and remote host
CN115333942A (en) Event retry method and device, storage medium and electronic equipment
CN113542409B (en) Management system and processing method for instances of RocktMQ message queues
CN114896035A (en) Cross-platform-space timed task scheduling management system

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
GR01 Patent grant
GR01 Patent grant