[rabbitmq-discuss] Error code 541
Eran Sandler
eran.sandler at gmail.com
Mon Sep 22 15:00:49 BST 2008
I'm happy to say that I may have found the problem to this issue.
If I run rabbitmq from the command line and NOT through erlsrv (in
Windows erlsrv will run as a Windows service) the process is alive and
well and not having any issues.
If I run it through erlsrv, it dies after less than 24 hours with the
annoying error code 541.
Since Windows is a bit more annoying with running background processes
(its not enough to add an "&" character :-) ) I wrote a small Windows
service that acts as a delegate and executes rabbitmq's batch file
(rabbitmq-server.bat).
If the real rabbitmq process dies from whatever reason, the Windows
service will stop as if it died as well. That allows me to mimic the
behavior one would see if running rabbitmq as a background process or as
a task during boot on Linux.
So far its running for about 48 hours without a problem.
If you want, I can share the little Windows Service (I called it
RabbitMQ Executer) with the list.
For ease of use and implementation time I wrote it in C# (in .NET), so
it requires the .NET runtime, but it can easily be written in native C
since all it does is open a thread and executes the RabbitMQ process.
Eran
Eran Sandler wrote:
> Here are the tests.
>
>
> There is the one project for producing stuff that looks like the
> messages I'm sending and a very simple consumer.
>
>
> This is VERY crude (I did this very quickly) stuff and I might be
> wrong in my programming paradigm that I use with RabbitMQ so please
> let me know of everything I should change.
>
>
> That's basically what I do.
>
>
> Be sure to define the username, password and virtual. This sample
> assumes there is a queue named ActionsQueue and it was already created
> (creating it with the CreateQueue sample that comes with the .NET
> library and making it durable will make it exactly how I've defined it).
>
>
> I don't use the automatic consumer that waits for data because I need
> some flexibility in that area, that's why I have the sleep part.
>
>
> Hope that will help,
>
> Eran
>
>
> Ben Hood wrote:
>
>> Eran,
>>
>> On Thu, Sep 11, 2008 at 1:57 PM, Eran Sandler <eran.sandler at gmail.com> wrote:
>>
>>> I don't use an exchange. I saw that its possible to use this without an
>>> exchange (but perhaps I'm screwing myself with regards to clustering, I
>>> haven't taken a closer look as to how to work well with clustering).
>>>
>>
>> No, that's fine. What you are doing is using what is known as the
>> default exchange. This means that message is routed to a queue with
>> the same name as the routing key.
>>
>>
>>> I think BasicConsume should work just fine. I saw that it can handle the Ack
>>> automatically. The reason I thought using BasicGet was to keep my options
>>> open as to refuse a message for a point in time where my consuming code will
>>> run on a couple of machines that might get upgraded sequentially. This might
>>> lead to scenario in which I have added a new message type I want to handle
>>> and I don't have the new code on all consumers.
>>>
>>
>> You can ack manually if you want to. Set the no_ack flag to true and
>> then make a application specific decision of whether to ack or not in
>> the onDeliver callback.
>>
>>
>>> Regarding the sample, I will write something quick based on my original code
>>> and send it so it will make your life (and mine) a lot nicer (and quicker)
>>>
>>
>> Cool, hopefully one of us will get some time to look at it.
>>
>> Ben
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080922/b330ec16/attachment.htm
More information about the rabbitmq-discuss
mailing list