You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2007/09/03 04:07:18 UTC

[jira] Commented: (DIRMINA-428) Message priorities

    [ https://issues.apache.org/jira/browse/DIRMINA-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524417 ] 

Trustin Lee commented on DIRMINA-428:
-------------------------------------

I'd prefer not to modify IoSession (i.e. adding write(Object, int)) because it will be effective only when the filter is inserted.  Providing some extension point on the filter side (e.g. using Comparator interface) or making the message classes to implement Comparable might be better solution.

> Message priorities
> ------------------
>
>                 Key: DIRMINA-428
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-428
>             Project: MINA
>          Issue Type: New Feature
>            Reporter: Adrian Sandor
>
> I would like MINA to support sending messages with different priorities, so that higher-priority messages will get sent out first (in the order that they were added to the queue, if they have the same priority)
> Here's how I think this could be implemented:
> - define different priorities; I suggest using numeric constants, such as LOWEST=0, LOW=25, NORMAL=50, HIGH=75, HIGHEST=100, allowing any custom values from 0 to 100
> - add a priority field to WriteRequest, and implement Comparable using it
> - add a write(Object message, int priority) method to IoSession
> - make write(message) call write(message, NORMAL)
> - make the writeRequestQueue in the session implementations a priority queue, but one that preserves the original order of "equal" elements
> - ensure that a higher priority message won't interrupt sending out another message (if pending)
> - if desired, write an IoFilter that can manipulate the priority

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.