We are not using the concept of the delayed messages so I don't think
that is our problem. To provide some background, I think our workflow
is very basic and I would not mind a sanity check as RQ is new to me.
We have a Windows Service accepting messages from numerous clients via
WCF enqueueing messages to RQ . Then another background thread is
processing those messages. We only have 1 RQ where as in the unit
tests I have seen a Sender and Receiver.

Here is the main parts of how we wrapped RQ. The key here is that we
have one instance of my RhinoQueue below and the WCF side just calls
Enqueue() and the background thread just calls Dequeue().

Now in the Enqueue() method I was originally using EnqueueDirectlyTo()
vs Send() but noticed I could get the ESENT DB to become corrupt that
way. Also notice GetCount(). Originally I was using
GetNumberOfMessages() but you stated that was a bug, so for now I am
getting collection count.

One last thing, where is that linqpad sample query? I grabbed the
latest version and don’t see that anywhere. Any guidance would be
appreciated.

public class RhinoQueue<T> : IQueue<T>
    {
        private readonly QueueManager queue;
        private readonly string queueName;
        private readonly string uri;

        public RhinoQueue(string queueName, int port)
        {
            this.queueName = queueName;
            this.uri = string.Format("rhino.queues://localhost:{0}/
{1}", port, queueName);
            queue = new QueueManager(new
IPEndPoint(IPAddress.Loopback, port), queueName);
            queue.CreateQueues(queueName);
            queue.Start();
        }


        public int GetCount()
        {
            return queue.GetAllMessages(queueName, null).Count();
            //looks to be bug in how below method call gets count.
Sticking with above call for now
            //return queue.GetNumberOfMessages(queueName);
        }

        public void Enqueue(T item)
        {
            using (var tx = new TransactionScope())
            {
                queue.Send(new Uri(uri), new MessagePayload {Data =
ObjectToByteArray(item)});
                tx.Complete();
            }
        }

        public T Dequeue()
        {
            using (var tx = new TransactionScope())
            {
                var msg = queue.Receive(queueName, new TimeSpan(0, 0,
30));
                tx.Complete();
                return (T) ByteArrayToObject(msg.Data);
            }
        }
}


On Sep 15, 9:42 pm, Corey Kaylor <[email protected]> wrote:
> There is a sample linqpad query that I've used in the past inside the
> rhino-queues repository when I need to peek into the contents of the queues.
> Curious though, are the alleged missed messages delayed messages? We just
> found a bug this afternoon that would caused timed messages to not get
> received under certain conditions.
>
>
>
>
>
>
>
> On Thu, Sep 15, 2011 at 1:49 PM, MichaelK <[email protected]> wrote:
> > I am trying to troubleshoot some alleged missed messages and I wanted
> > to see what was stored in the RhinoQueue esent DB. My initial thought
> > was to just copy over the esent files that RQ creates from Test Server
> > to my machine and write a simple console app to view what has been
> > processed. I was unable to open up the file using QueueManager
>
> > var queue = new QueueManager(new IPEndPoint(IPAddress.Loopback,
> > 45231), path);
>
> > My next though was to use one of the two free viewers I found
> > regarding esent DBs
>
> >http://www.orthogonal.com.au/computers/esent/
> >http://www.woany.co.uk/news/esedbviewer-v1-0-0/
>
> > Both of those applications came back with DirtyShutdownExeptions.
> > (Note I also had to rename the file and add the .edb extension. I am
> > assuming RQ is just not creating the esent DB with that extension)
>
> > Any ideas on how one can go about troubleshooting RQ. I would like to
> > be able to review what is in the esent DB. I would assume anyone using
> > RQ has come accross the same requirements so I am open to any
> > suggestions. I would think I should be able to copy over the RQ esent
> > files and view them on another machine
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Rhino Tools Dev" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/rhino-tools-dev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to