简体   繁体   English

MSMQ查找特定的返回消息

[英]MSMQ find a particular returning message

Intention : I want to create a console, after the console execute the first queue, they will generate something like receipe data and throw into the second queue, another console , they will grab the data from the second queue and execute. 目的:我要创建一个控制台,在该控制台执行第一个队列后,它们将生成诸如receipe数据之类的东西并扔入第二个队列中,另一个控制台将从第二个队列中获取数据并执行。

The thing is, what if the second queue have one million records. 问题是,如果第二个队列有一百万条记录,该怎么办。 I dont want to loop one million record and throw it back and it will consume big usage of the server and it is not efficiency. 我不想循环一百万条记录并将其扔回去,这会消耗大量服务器资源,而且效率不高。

Is it able to, given a self generated id to the label, and find the particular message with one code? 给标签赋予一个自己生成的ID,是否能够用一个代码找到特定的消息?

for example, datatable tempDt; 例如,数据表tempDt;

tempDt.Select("id = '"+id+"'"); tempDt.Select(“ id ='” + id +“'”);

something like this 像这样的东西

Have a look here : you can use 在这里看看:您可以使用

queue.ReceiveById(...);

to get a specific message. 以获得特定的消息。 From the msdn page: "Use this method to read a message with a known identifier and remove it from the queue." 在msdn页面上:“使用此方法读取具有已知标识符的消息并将其从队列中删除。”

Not a self-generated id, but may be useful to you... 这不是一个自我生成的ID,但可能对您有用...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM