左心室强光点是什么意思| 无名指麻木是什么原因| edf是什么意思| 夜里12点是什么时辰| 小腿酸胀痛是什么原因| 酸菜鱼加什么配菜好吃| 怀孕吃什么可以快速流产| 气血不足什么引起的| 什么地端详| 什么来什么去的四字词语| 撤退性出血什么意思| 阴部痒痒的是什么原因| 手汗多是什么原因| wc的完整形式是什么| 7月17日是什么日子| tl是什么意思| 诛心是什么意思| 苹果和什么榨汁减肥| 肺气肿吃什么药| 空腹打嗝是什么原因引起的| 为什么要睡觉| 大象又什么又什么| 山本耀司的品牌叫什么| 什么是乳腺结节| 痛风什么原因引起| 最好的补钙方法是什么| 拔罐有什么好处| 梦见杀羊是什么预兆| 疝气手术是什么| 什么是小奶狗| 怀孕肚子上长毛是什么原因| 江西景德镇有什么好玩的地方| 1974年属什么生肖| 吃葡萄干对身体有什么好处| 女人梦到蛇预示着什么| 腊八节吃什么| 怀孕吃什么宝宝会白| 蒸馒头用什么面粉| 维生素b12治什么病| 丙肝有什么症状表现| 安徽菜属于什么菜系| 弥散是什么意思| 焕字五行属什么| 头发油性大是什么原因| 3.19是什么星座| 什么叫做缘分| av是什么意思| 什么中毒查不出来| 什么大什么小| 解脲脲原体阳性是什么| ao是什么意思| 接龙是什么意思| 什么情况下需要做宫腔镜| nnd什么意思| 看淡一切对什么都没兴趣| 心脏上有个小洞是什么病| 过的第五笔是什么| 喝什么可以减肥| 知性是什么意思| ts和cd有什么区别| 全身皮肤瘙痒是什么原因| 手脚发热是什么原因| 分率是什么意思| 黄疸是什么样子的图片| 举世无双什么意思| 肾衰竭有什么症状| 牡丹是什么季节开的| 阿魏是什么中药| 雀子是什么意思| 例假一个月来两次是什么原因| 急性肠胃炎可以吃什么食物| 黄帝是一个什么样的人| mcn是什么意思| 五七干校是什么意思| 玉兰片和竹笋有什么区别| 腹膜透析是什么意思| 奇门遁甲什么意思| 常州为什么叫龙城| 坐骨神经有什么症状| 儿童包皮过长挂什么科| 丝瓜烧什么好吃| 为什么会高反| 老放屁是什么病的征兆| 6周岁打什么疫苗| 猫尿床是因为什么原因| 郡主是什么意思| 另起炉灶是什么意思| 便秘吃什么益生菌| sport什么品牌| 提高免疫力吃什么食物| 病例是什么| 麻豆是什么意思| 女人绝经后靠什么排毒| 夏天猪骨煲什么汤最好| 培根是什么| 怀孕了为什么还会出血| vcr是什么| 什么学习机好| 减肥吃什么药效果最好| 梦到老公出轨是什么意思| 冰心原名叫什么名字| 感化是什么意思| 蒟蒻是什么东西| 反流性食管炎吃什么中药| 情人和小三的区别是什么| 天山童姥练的什么武功| 平的反义词是什么| 什么学习机好| 发烧去医院挂什么科| 大电念什么| hisense是什么牌子| 扁桃体挂什么科| 十二指肠溃疡a1期什么意思| 井什么有什么| 骨质密度增高是什么意思| 脑电图是检查什么的| 微信上面有个耳朵是什么意思| 丙氨酸氨基转移酶是查什么的| 高筋小麦粉适合做什么| 柯南叫什么| 小金人车标是什么车| 心灵的洗礼是什么意思| 红花跟藏红花有什么区别| 屁眼疼痛什么原因| 肚子胀气吃什么通气| 真丝乔其纱是什么面料| 耳朵流血是什么原因| 吃了避孕药不能吃什么东西| 世界上什么动物牙齿最多| 平板和ipad有什么区别| 口蘑不能和什么一起吃| 淋巴结稍大是什么意思| asa是什么意思| 胀气是什么症状| 兔子可以吃什么水果| 什么是扁平疣| 西康省是现在什么地方| 富贵包去医院挂什么科| 50岁吃什么钙片补钙效果好| 撒贝宁是什么民族| 涤纶是什么面料优缺点| 跟腱为什么会断裂| 2009年是什么生肖年| 兔日冲鸡什么意思| 西葫芦不能和什么一起吃| pf是什么意思| 接触性皮炎用什么药膏| 牙根痛吃什么药| 头皮挂什么科| 聚乙二醇是什么| 心绪不宁的意思是什么| 熟褐色是什么颜色| 世界什么| 撕漫男什么意思| 打喷嚏是什么意思| 天秤座和什么星座最配| 择日是什么意思| 孩子爱咬指甲是什么原因| 为什么不嫁丧妻之男| 牛皮癣是什么| 边缘性人格障碍是什么| 感康是什么药| 吃牛油果有什么好处| 女性为什么会感染巨细胞病毒| 深海鱼油有什么功效| 谷草转氨酶高吃什么药| 什么水果是发物| 守望先锋是什么类型的游戏| chris是什么意思| 喝冰糖水有什么好处和坏处| 一什么陆地| 地中海贫血携带者是什么意思| 12月3号是什么星座| 血钾是什么意思| 脱肛是什么样子的| 小孩子拉肚子吃什么药| 眉毛里有痣代表什么| upup是什么意思| 槐花蜜是什么颜色| 扫墓是什么意思| 刘亦菲是什么星座| 桂花代表什么生肖| 毛血旺是什么菜| 天蝎座属于什么象星座| 千古一帝指什么生肖| 皮炎是什么症状| 反复感冒是什么原因引起的| 视什么如什么| 店铺开业送什么礼物好| 过敏性紫癜吃什么药| 10.19什么星座| 早上7点多是什么时辰| 茉莉花是什么颜色| 咳嗽有黄痰是什么原因| 女人梦见好多蛇是什么预兆| 浪人是什么意思| 13楼五行属什么| 猎奇是什么| 荨麻疹吃什么药管用| 四月二十是什么星座| 金句是什么意思| 7点至9点是什么时辰| 中老年人喝什么奶粉好| 为什么一同房就有炎症| 前白蛋白偏低是什么意思| 皮的偏旁是什么| 中国国花是什么花| 男生吃菠萝有什么好处| 啤酒加生鸡蛋一起喝有什么效果| 一月十八是什么星座| 免疫十一项都检查什么| 什么情况下要打破伤风针| 麻薯是什么| 风凉话是什么意思| 芼什么意思| 甲状腺有什么症状| 肠胃痉挛什么症状| 托塔李天王的塔叫什么| 左眼皮跳是什么预兆女| 胃粘膜脱落什么症状严重吗| 伟字五行属什么| 咳嗽有痰是什么原因| 切花是什么意思| 佛手是什么东西| 至死不渝是什么意思| 萌萌哒是什么意思| 张家界地貌属于什么地貌| 火车上不能带什么| 十多块钱的烟什么好抽| 生殖器疱疹是什么| 腰部酸胀是什么原因| 水痘长什么样子的图片| 翕什么意思| 对等是什么意思| 不善言辞是什么意思| 甘油三酯偏高是什么原因| 痛心疾首的疾什么意思| 幼儿园转园需要什么手续| 荡漾什么意思| 孔雀吃什么食物| 幼儿腹泻吃什么食物| 红豆有什么功效和作用| 武汉大学校长是什么级别| 国士无双是什么意思| 假酒喝了有什么症状| 尿酸盐结晶是什么意思| 属马是什么星座| 尖锐什么意思| 胰腺炎什么症状| 尿结晶是什么意思| prn医学上是什么意思| 经血是什么血| 血糖高吃什么水果| 治疗风湿有什么好方法| 口腔溃疡缺乏什么维生素| 98年什么命| 开山鼻祖是什么意思| 肝不好有什么症状| 心有戚戚焉什么意思| 嗔心是什么意思| 1930年属什么| 梦见自己扫地是什么意思| adr是什么意思| 荣辱与共是什么意思| 百度Jump to content

北京表 与先锋同行 携手“帝君”品鉴时计魅力

From Wikipedia, the free encyclopedia
百度 刘德良认为。

In computer science, message queues and mailboxes are software-engineering components typically used for inter-process communication (IPC), or for inter-thread communication within the same process. They use a queue for messaging – the passing of control or of content. Group communication systems provide similar kinds of functionality.

The message queue paradigm is a sibling of the publisher/subscriber pattern, and is typically one part of a larger message-oriented middleware system. Most messaging systems support both the publisher/subscriber and message queue models in their API, e.g. Java Message Service (JMS).

Competing Consumers pattern enables multiple concurrent consumers to process messages on the same message queue. [1]

Remit and ownership

[edit]

Message queues implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the message queue at the same time. Messages placed onto the queue are stored until the recipient retrieves them. Message queues have implicit or explicit limits on the size of data that may be transmitted in a single message and the number of messages that may remain outstanding on the queue.[2]

Remit

[edit]

Many implementations of message queues function internally within an operating system or within an application. Such queues exist for the purposes of that system only.[3][4][5]

Other implementations allow the passing of messages between different computer systems, potentially connecting multiple applications and multiple operating systems.[6] These message queuing systems typically provide resilience functionality to ensure that messages do not get "lost" in the event of a system failure. Examples of commercial implementations of this kind of message queuing software (also known as message-oriented middleware) include IBM MQ (formerly MQ Series) and Oracle Advanced Queuing (AQ). There is a Java standard called Java Message Service, which has several proprietary and free software implementations.

Real-time operating systems (RTOSes) such as VxWorks and QNX encourage the use of message queuing as the primary inter-process or inter-thread communication mechanism. This can result in integration between message passing and CPU scheduling. Early examples of commercial RTOSes that encouraged a message-queue basis to inter-thread communication also include VRTX and pSOS+, both of which date to the early 1980s. The Erlang programming language uses processes to provide concurrency; these processes communicate asynchronously using message queuing.

Ownership

[edit]

The message queue software can be either proprietary, open source or a mix of both. It is then run either on premise in private servers or on external cloud servers (message queuing service).

Examples on hardware-based messaging middleware vendors are Solace, Apigee, and IBM MQ.

Usage

[edit]

In a typical message-queueing implementation, a system administrator installs and configures message-queueing software (a queue manager or broker), and defines a named message queue. Or they register with a message queuing service.

An application then registers a software routine that "listens" for messages placed onto the queue.

Second and subsequent applications may connect to the queue and transfer a message onto it.

The queue-manager software stores the messages until a receiving application connects and then calls the registered software routine. The receiving application then processes the message in an appropriate manner.

There are often numerous options as to the exact semantics of message passing, including:

  • Durability – messages may be kept in memory, written to disk, or even committed to a DBMS if the need for reliability indicates a more resource-intensive solution.
  • Security policies – which applications should have access to these messages?
  • Message purging policies – queues or messages may have a "time to live".
  • Message filtering – some systems support filtering data so that a subscriber may only see messages matching some pre-specified criteria of interest.
  • Delivery policies – do we need to guarantee that a message is delivered at least once, or no more than once?
  • Routing policies – in a system with many queue servers, what servers should receive a message or a queue's messages?
  • Batching policies – should messages be delivered immediately? Or should the system wait a bit and try to deliver many messages at once?
  • Queuing criteria – when should a message be considered "enqueued"? When one queue has it? Or when it has been forwarded to at least one remote queue? Or to all queues?
  • Receipt notification – A publisher may need to know when some or all subscribers have received a message.

These are all considerations that can have substantial effects on transaction semantics, system reliability, and system efficiency.

Standards and protocols

[edit]

Historically, message queuing has used proprietary, closed protocols, restricting the ability for different operating systems or programming languages to interact in a heterogeneous set of environments.

An early attempt to make message queuing more ubiquitous was Sun Microsystems' JMS specification, which provided a Java-only abstraction of a client API. This allowed Java developers to switch between providers of message queuing in a fashion similar to that of developers using SQL databases. In practice, given the diversity of message queuing techniques and scenarios, this wasn't always as practical as it could be.

Three standards have emerged which are used in open source message queue implementations:

  1. Advanced Message Queuing Protocol (AMQP) – feature-rich message queue protocol, approved as ISO/IEC 19464 since April 2014
  2. Streaming Text Oriented Messaging Protocol (STOMP) – simple, text-oriented message protocol
  3. MQTT (formerly MQ Telemetry Transport) – lightweight message queue protocol especially for embedded devices

These protocols are at different stages of standardization and adoption. The first two operate at the same level as HTTP, MQTT at the level of TCP/IP.

Some proprietary implementations also use HTTP to provide message queuing by some implementations, such as Amazon's SQS. This is because it is always possible to layer asynchronous behaviour (which is what is required for message queuing) over a synchronous protocol using request-response semantics. However, such implementations are constrained by the underlying protocol in this case and may not be able to offer the full fidelity or set of options required in message passing above.

Synchronous vs. asynchronous

[edit]

Many of the more widely known communications protocols in use operate synchronously. The HTTP protocol – used in the World Wide Web and in web services – offers an obvious example where a user sends a request for a web page and then waits for a reply.

However, scenarios exist in which synchronous behaviour is not appropriate. For example, AJAX (Asynchronous JavaScript and XML) can be used to asynchronously send text, JSON or XML messages to update part of a web page with more relevant information. Google uses this approach for their Google Suggest, a search feature which sends the user's partially typed queries to Google's servers and returns a list of possible full queries the user might be interested in the process of typing. This list is asynchronously updated as the user types.

Other asynchronous examples exist in event notification systems and publish/subscribe systems.

  • An application may need to notify another that an event has occurred, but does not need to wait for a response.
  • In publish/subscribe systems, an application "publishes" information for any number of clients to read.

In both of the above examples it would not make sense for the sender of the information to have to wait if, for example, one of the recipients had crashed.

Applications need not be exclusively synchronous or asynchronous. An interactive application may need to respond to certain parts of a request immediately (such as telling a customer that a sales request has been accepted, and handling the promise to draw on inventory), but may queue other parts (such as completing calculation of billing, forwarding data to the central accounting system, and calling on all sorts of other services) to be done some time later.

In all these sorts of situations, having a subsystem which performs message-queuing (or alternatively, a broadcast messaging system) can help improve the behavior of the overall system.

Implementation in UNIX

[edit]

There are two common message queue implementations in UNIX. One is part of the SYS V API, the other one is part of POSIX.

SYS V

[edit]

UNIX SYS V implements message passing by keeping an array of linked lists as message queues. Each message queue is identified by its index in the array, and has a unique descriptor. A given index can have multiple possible descriptors. UNIX gives standard functions to access the message passing feature.[7]

msgget()
This system call takes a key as an argument and returns a descriptor of the queue with the matching key if it exists. If it does not exist, and the IPC_CREAT flag is set, it makes a new message queue with the given key and returns its descriptor.
msgrcv()
Used to receive a message from a given queue descriptor. The caller process must have read permissions for the queue. It is of two types.[8]
  • Blocking receive puts the child to sleep if it cannot find a requested message type. It sleeps until another message is posted in the queue, and then wakes up to check again.
  • Non-blocking receive returns immediately to the caller, mentioning that it failed.
msgctl()
Used to change message queue parameters like the owner. Most importantly, it is used to delete the message queue by passing the IPC_RMID flag. A message queue can be deleted only by its creator, owner, or the superuser.

POSIX

[edit]

The POSIX.1-2001 message queue API is the later of the two UNIX message queue APIs. It is distinct from the SYS V API, but provides similar function. The unix man page mq_overview(7) provides an overview of POSIX message queues.

Graphical user interfaces

[edit]

Graphical user interfaces (GUIs) employ a message queue, also called an event queue or input queue, to pass graphical input actions, such as mouse clicks, keyboard events, or other user inputs, to the application program.[9] The windowing system places messages indicating user or other events, such as timer ticks or messages sent by other threads, into the message queue. The GUI application removes these events one at a time by calling a routine called getNextEvent() or similar in an event loop, and then calling the appropriate application routine to process that event.[10]

See also

[edit]

References

[edit]
  1. ^ Gorton, Ian. Foundations of Scalable Systems. O'Reilly Media. ISBN 9781098106034.
  2. ^ Dive Into Queue Module In Python. Overview of POSIX message queues
  3. ^ Win32 system message queues. "About Messages and Message Queues". Windows User Interface. Microsoft Developer Network. Archived from the original on March 17, 2012. Retrieved April 21, 2010.
  4. ^ Linux and POSIX message queues. Overview of POSIX message queues Archived 2025-08-05 at the Wayback Machine at linux.die.net
  5. ^ Using Linux Message Queues. Linux message queue functions Archived 2025-08-05 at the Wayback Machine at www.civilized.com
  6. ^ For example, the MSMQ product. "Message Queuing (MSMQ)". Network Communication. Microsoft Developer Network. Retrieved May 9, 2009.
  7. ^ Bach, M.J. (1986). The Design of the UNIX Operating System. Prentice-Hall. ISBN 9780132017992.
  8. ^ Abraham Silberschatz, Peter B. Galvin (1994). Operating Systems Concepts. Addison-Wesley. ISBN 9780201504804.
  9. ^ Cartwright, Corky. "GUI Programming". Rice University:Robert (Corky) Cartwright. Retrieved June 27, 2020.
  10. ^ Nystrom, Robert (2014). Game Programming Patterns. Genever Benning. ISBN 978-0990582908. Retrieved June 27, 2020.
梦见倒房子是什么预兆 做肠镜要做什么准备 梅毒会通过什么传染 医学ace是什么意思 生物学是什么
批号是什么意思 海南有什么水果 腰疼是什么原因 沅字五行属什么 嗓子不舒服吃什么水果
向日葵花语是什么 gs是什么 中筋面粉是什么粉 流金是什么字 中秋节干什么
脂蛋白a高是什么意思 2036年是什么年 马云父母是做什么的 拉肚子可以喝什么 爱出汗是什么原因
用什么泡脚去湿气寒气hlguo.com 婵字五行属什么hcv7jop6ns9r.cn 白敬亭原名叫什么hcv8jop6ns2r.cn 中医心脉受损什么意思hcv9jop3ns3r.cn 兔子不吃窝边草是什么意思hcv9jop2ns1r.cn
野生蜂蜜有什么好处和作用hcv9jop4ns8r.cn 腿脚浮肿是什么原因引起的hcv8jop9ns6r.cn 生门是什么意思hcv8jop0ns6r.cn 后援会是什么意思hcv8jop7ns1r.cn ok镜是什么hcv7jop9ns0r.cn
克隆恩病是什么hcv7jop4ns7r.cn 第二视角是什么意思hcv8jop8ns3r.cn 1月4日是什么星座hcv8jop7ns0r.cn 身上长疣是什么原因hcv7jop7ns1r.cn 抠鼻表情什么意思hcv8jop9ns4r.cn
不治身亡是什么意思hcv7jop9ns1r.cn 高考用什么笔jingluanji.com 头皮毛囊炎用什么洗发水hebeidezhi.com 白细胞3个加号是什么意思hlguo.com 58年属什么生肖hcv9jop7ns9r.cn
百度