应该如何实现消息队列程序? [英] How should a message queue program be implemented?

查看:94
本文介绍了应该如何实现消息队列程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我必须实现一个基于REST的所谓消息队列程序,不使用任何额外的库或现成的实现,如RabbitMQ,MSMQ等(但应该类似)。

我只需要一些注释和代码行(C#,C ++,Java)来实现它应该如何工作。更简单的解释我更感激!

提前谢谢你!)



我尝试过的事情:



谷歌搜索引擎根据消息队列的现成实现建议程序:(

解决方案

她是一些代码行作为原则解决方案:

  while (!isQueueEmpty()){
Msg * msg = getMessage();

if (msg-> send()== OK){
RemoveMsgFromQueue( msg);
}
};





我希望你能得到它;-)

(答案与你的问题处于同一水平)



提示:但是在没有使用某些库的情况下编写程序是没有意义的。


Hello to everyone!
I have to implement a so called message queue program based on REST WITHOUT using any extra libraries or ready implementations as RabbitMQ , MSMQ and so on (but should be similar).
I just need a few comments and lines of code (C# , C++ , Java) to realize how it should work. The simplier explanation the more grateful I am!
Thank you in advance)!

What I have tried:

google search engine suggests programs based on ready implementations of message queues:(

解决方案

Her are some lines of code as principle solution:

while( !isQueueEmpty() ) {
  Msg *msg = getMessage();
  
 if( msg->send() == OK ) {
    RemoveMsgFromQueue(msg);
 }
};



I hope you get it ;-)
(that the answer is at the same level as your question)

tip: But it makes no sense to write a program without the use of some libraries.


这篇关于应该如何实现消息队列程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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