3 Replies - 1629 Views - Last Post: 23 April 2013 - 04:33 AM

#1 Kirubanandam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-April 13

How to check if the private queue is empty or not?

Posted 17 April 2013 - 11:34 AM

Hi,

I have got the below code to retrieve the message from MSMQ using Javascript. It retrieves the message from MSMQ if there is a messages in the queue. Browser it hangs, it tries to retrieve the message but there is no message in the queue.

if anyone knows the Javascript code to check if the private queue is empty or not, Please share it to me.

I look forward to your reply.

Thanks in Advance.
Kiruba

var qi = new ActiveXObject ("MSMQ.MSMQQueueInfo");
qi.pathname = ".\\private$\\myqueue";

var MQ_SEND_ACCESS = 2;
var MQ_DENY_NONE = 0;

var q;
q = qi.Open (MQ_SEND_ACCESS, MQ_DENY_NONE);

var msg = new ActiveXObject ("MSMQ.MSMQMessage");

msg.body = "Hello World";
msg.label = "Hello World label";

msg.Send (q);



Is This A Good Question/Topic? 0
  • +

Replies To: How to check if the private queue is empty or not?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3555
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: How to check if the private queue is empty or not?

Posted 17 April 2013 - 11:45 AM

View PostKirubanandam, on 17 April 2013 - 08:34 PM, said:

if anyone knows the Javascript code to check if the private queue is empty or not, Please share it to me.

Im not an expert, but I would say there is no direct way for JS to do that, rather you have to use the methods/properties the the MSMQ-objects provide to you (resp. JS).
Was This Post Helpful? 0
  • +
  • -

#3 Kirubanandam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-April 13

Re: How to check if the private queue is empty or not?

Posted 17 April 2013 - 09:08 PM

There is a method called MSMQQueue.Peek(..), it returns a message, and check if the queue is empty, it will throw an error. I don't know, how to use this method.

If any knows how to use this method MSMQQueue.Peek, please let me know.
Was This Post Helpful? 0
  • +
  • -

#4 Kirubanandam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-April 13

Re: How to check if the private queue is empty or not?

Posted 23 April 2013 - 04:33 AM

The below link provides the solution for this problem. It has the function to checks whether the private MSMQ is empty or not.

http://stackoverflow...ue-with-jscript
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1