首页 \ 问答 \ 是否可以在RabbitMQ中使用交换?(Is it possible to consume an exchange in RabbitMQ?)

是否可以在RabbitMQ中使用交换?(Is it possible to consume an exchange in RabbitMQ?)

也许我在这里问错了问题。

我正在尝试做的事情:多个生产者将动态类别中的数据推送到命名交换中。 多个消费者需要从这些动态命名的队列中获取这些数据并对其进行操作。

问题是我看到的所有消费示例都要求消费者/订阅具有特定的队列名称,而我的消费者不知道队列的名称,他们也不需要知道这一点。

我为什么要这样做? 两个原因:

  1. 我一次可以拥有N个这些动态类别。 我希望队列能够平等地服务于这些类别。 目前我们有一个队列(msmq)接受所有这些类别并在FIFO中提供它们(这意味着某些类别在一段时间内会被饿死)。

  2. 能够平等地服务所有类别,而不是fifo,让我提出有趣的QoS(默认情况下我理解Rabbit将循环服务消息)。

所以,回到我的问题(如果它有效):是否可以消耗队列中的消息?


Maybe I am asking the wrong question here.

what I'm trying to do: multiple producers push data in dynamic categories into a Named exchange. multiple consumers need to pick up this data from these dynamically named queues and act on them.

the problem is that all of the examples of consumption that I see require the consumer/subscription to have a specific queue name, and my consumers dont know the names of the queues, nor do they need to know this.

why am I doing this? two reasons:

  1. I can have N of these dynamic categories at a time. I'd like the queue to serve these categories equally. currently we have one queue (msmq) which accepts all of these categories and serves them in FIFO (which means that some categories are starved for some time).

  2. Being able to serve all categories equally, rather than fifo, lets me come up with interesting QoS (by default I understand that Rabbit will round-robin serve messages).

so, back to my question (if its valid): is it possible to consume messages from a queue?


原文:https://stackoverflow.com/questions/8350111
更新时间:2023-03-29 18:03

最满意答案

使用旧事件中的new Event构造一个新事件并修改这些值:

var newEvent = new Event(e);
newEvent.pageX = calcNewPageX();

参考: https//developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events


Construct a new event with new Event from your old event and modify those values:

var newEvent = new Event(e);
newEvent.pageX = calcNewPageX();

Ref: https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events

相关问答

更多
  • 使用旧事件中的new Event构造一个新事件并修改这些值: var newEvent = new Event(e); newEvent.pageX = calcNewPageX(); 参考: https : //developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events Construct a new event with new Event from your old event and modify ...
  • 更改Foo构造函数的声明以包含基类的构造函数: Foo(BaseClass* bc, int x, const char *value): BaseClass(*bc) Change your declaration of the Foo constructor to include a constructor for the base class: Foo(BaseClass* bc, int x, const char *value): BaseClass(*bc)
  • 尽管每个人都说,但您可以在支持Object.defineProperty现代浏览器中创建只读属性。 var obj = {}; Object.defineProperty(obj, 'someProp', { configurable: false, writable: false, value: 'initial value' }); obj.someProp = 'some other value'; console.log(obj.someProp); //initial ...
  • 编辑:由于这个答案是写的,使用Object.defineProperty的新的更好的方法已经在EcmaScript 5中进行了标准化,在较新的浏览器中得到了支持。 看到艾达米娜的答案 。 如果您需要支持“较旧”的浏览器,则可以使用此答案中的一种方法作为后备。 在Firefox,Opera 9.5+和Safari 3+中,Chrome和IE(使用v11进行测试)可以定义getter和setter属性。 如果只定义一个getter,它将有效地创建只读属性。 您可以在对象文字中或通过调用对象上的方法来定义它们。 ...
  • 为什么允许分配,如果允许,怎么会发生什么? 在这段代码中没有推断的范围,所以我不明白JS中的某些东西是如何推断私有财产的。 因为任务(在严格模式之前)永远不会抛出并且抛出它会违反人们期望的那种不变。 尽管你仍然可以覆盖它(通过创建一个setter并进行抛出),但这是JavaScript中属性的默认行为。 我们不喜欢它,但它就是这样。 如果你使用严格模式 - 你应该得到: TypeError:设置只有一个getter的属性 Why is assignment allowed, and if it's allo ...
  • 建立一个关于如何实现Javascript对象的心理模型是非常重要的:如果您来自C ++背景,那么请考虑这种可能的模型 在JavaScript中的所有对象都是相同的类,类“对象” 每个对象都用类似的东西来定义 class Object { std::map attributes; }; 这意味着例如 这组属性不是固定的,您可以在运行时将属性添加到特定的对象实例 继承在C ++中不起作用 每个对象都有一个名为constructor的特殊属性 对象的cons ...
  • 对不起,用C ++ 语法糖不在那里 ,这意味着你必须自己实现get / set方法。 所以在你的情况下,你将不得不实现一个getVariable()方法,而不使用它的等价Set方法,以使其只读。 请不要诉诸宏来使它看起来像你有一些只读属性。 5年后,当他们阅读你的代码时,这只会让人不满。 Sorry, with C++, the syntactic sugar is not there, which means you have to implement the get/set methods yourse ...
  • 经过一番思考后,我想出了这个解决方案。 适合我的需求,所以我想我会分享它的QnA风格。 如果您找到它们,请建议任何改进/问题。 /** * Make the the specified object (deeply) immutable or "read-only", so that none of its * properties (or sub-properties) can be modified. The converted object is returned. * @param {obje ...
  • 您的优化是无用的,将产生完全相同的代码。 所有readonly都是微不足道的,并且将被内联,消除了使用原始T可能产生的任何开销。因此,解决方案是不修复不存在的问题,并且只使用readonly ,无论这是否是否是调试版本。 正如@MooingDuck所指出的那样,你应该改变你的构造函数以使用init list(也可能使它明确)。 Your optimisation is useless and will result in the exact same code. All of readonl ...
  • 这是可能的,但价格昂贵。 您可以通过拥有一个真正的私有成员变量,然后提供一个访问器函数来实现: var NiftyThing = function() { var trulyPrivateVariable; trulyPrivateVariable = 5; // For instance this.accessorFunction = function() { return trulyPrivateVariable; } }; 这是有效的,因为访问器函数 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)