什么是MQ,为什么我要使用它? [英] What is an MQ and why do I want to use it?

查看:178
本文介绍了什么是MQ,为什么我要使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的工作团队中,我们经常使用IBM MQ技术进行跨应用程序通信。我最近在Hacker News和其他地方见过其他MQ技术,例如 RabbitMQ 。我对它是什么(对放置和获取消息的常用检查区域)有基本的了解,但是我想知道它到底在做什么?我怎么知道我要在哪里使用它?何时使用?为什么不仅仅坚持使用更基本的进程间消息传递形式呢?

On my team at work, we use the IBM MQ technology a lot for cross-application communication. I've seen lately on Hacker News and other places about other MQ technologies like RabbitMQ. I have a basic understanding of what it is (a commonly checked area to put and get messages), but what I want to know what exactly is it good at? How will I know where I want to use it and when? Why not just stick with more rudimentary forms of interprocess messaging?

推荐答案

到目前为止,所有的解释都是准确的,而且要切合实际-可能缺少某些东西:消息队列的主要好处之一是弹性。

All the explanations so far are accurate and to the point - but might be missing something: one of the main benefits of message queueing: resilience.

想象一下:您需要与另外两个或三个系统进行通信。如今,Web服务是一种常见的方法,如果您立即需要答案,这很好。

Imagine this: you need to communicate with two or three other systems. A common approach these days will be web services which is fine if you need an answers right away.

但是:Web服务可能会关闭并且不可用-您怎么办然后?在这种情况下,通常可以将您的消息放入消息队列(该消息队列在计算机/服务器上也具有组件),在这种情况下-您的消息只是无法立即传递并因此得到处理-但稍后,当另一个服务的另一端又重新联机。

However: web services can be down and not available - what do you do then? Putting your message into a message queue (which has a component on your machine/server, too) typically will work in this scenario - your message just doesn't get delivered and thus processed right now - but it will later on, when the other side of the service comes back online.

因此,在许多情况下,使用消息队列连接不同的系统是一种来回发送消息的更可靠,更可靠的方法。它并非对所有情况都有效(如果您想了解MSFT的当前价格,将请求放入队列中可能不是最好的主意)-但在很多情况下,例如将订单放入供应商的消息队列中,它确实运行良好,并且可以帮助缓解其他技术的一些可靠性问题。

So in many cases, using message queues to connect disparate systems is a more reliable, more robust way of sending messages back and forth. It doesn't work well for everything (if you want to know the current stock price for MSFT, putting that request into a queue might not be the best of ideas) - but in lots of cases, like putting an order into your supplier's message queue, it works really well and can help ease some of the reliability issues with other technologies.

这篇关于什么是MQ,为什么我要使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆