Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue on non persistent queue #4

Open
filippomar opened this issue Mar 15, 2017 · 4 comments
Open

Possible issue on non persistent queue #4

filippomar opened this issue Mar 15, 2017 · 4 comments

Comments

@filippomar
Copy link

Hi,
time ago I used DotNetMQ on a project (compliments for the amazing job) and have found a possible issue on non persistent queue.

FILE: MDSPersistentRemoteApplicationBase.cs
METHOD: EnqueueMessage(MDSDataTransferMessage message) method
ROW:
//Add message to queue.
_waitingMessages.AddFirst(new WaitingMessage(messageRecord));

As per my understanding this is a LIFO queue, but I think it is more correct to have a FIFO queue, so I fixed it in:
//Add message to queue.
_waitingMessages.AddLast(new WaitingMessage(messageRecord));

Please let me know your feedback about that.

Thank you,
F

@hikalkan
Copy link
Owner

hikalkan commented Mar 15, 2017

It's done like that to set high priority to transient messages. For persistent messages, it's added to the last item:

_waitingMessages.AddLast(new WaitingMessage(messageRecord));

@filippomar
Copy link
Author

filippomar commented Mar 15, 2017

Ok, I understand that this is your desired behavior.
But in a condition in which the producer is sending non-persistent messages faster then the consumer get it, you keep oldest message in the queue indefinitely.
This is what happens to me so I wanted to change that behavior.
Thanks for your feedback.

@hikalkan
Copy link
Owner

Understand it. DotNetMQ is focused on persistent messages so I thought there will not be much transient messages. Adding it as the last item may cause waiting transient messages too much. Maybe we should better design it, but I'm not actively working on this project.

@filippomar
Copy link
Author

Don't matter, this library is almost perfect as is, this is the only unwanted behaviour I had in a long time I used it.
Thank you and again compliments for your job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants