activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <jira+amq...@apache.org>
Subject [jira] Commented: (AMQNET-248) Duplicate MessageID received.
Date Sat, 01 May 2010 23:40:20 GMT

    [ https://issues.apache.org/activemq/browse/AMQNET-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59189#action_59189
] 

Timothy Bish commented on AMQNET-248:
-------------------------------------

Yes, the code is incorrect, looks like I messed that up while translating everything over
from the original NMS.ActiveMQ stomp code.  The real way to do it now is to just call MessageId.ToString().
 

I've cleaned up the code some and am adding some more tests and some additional code to better
handle use with non-ActiveMQ brokers.  

> Duplicate MessageID received.
> -----------------------------
>
>                 Key: AMQNET-248
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-248
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: Stomp
>    Affects Versions: 1.2.0
>         Environment: ActiveMQ.NMS 1.2.0 Stomp Protocol
> Windows Mobile 5.x
> Compact Framework 3.5
>            Reporter: Steve Higgins
>            Assignee: Timothy Bish
>             Fix For: 1.3.0
>
>
> There is a bug which causes duplicate MessageIDs to be received. Note, the Message IDs
are duplicated not the actual messages.  This happens if a producer  sends several messages
to the same queue over the same session.
> Note 1: In MessageID.cs SetValue(string messageKey) the producerSequenceId is stripped
from the original unique key when a message is received.
> {code}
> public void SetValue(string messageKey)
> {
>     this.key = messageKey;
>     // Parse off the sequenceId
>     int p = messageKey.LastIndexOf(":");
>     if(p >= 0)
>     {
>         producerSequenceId = Int64.Parse(messageKey.Substring(p + 1));
>         messageKey = messageKey.Substring(0, p);
>     }
>     producerId = new ProducerId(messageKey);
> }
> {code}
> Note 2: In the Message.cs NMSMessageId get method the unique Id is reconstructed without
the sequence id. Because the sequence id is part of what makes the message id itself unique,
multiple received messages will now have the same id.
> {code}
>         public string NMSMessageId
>         {
>             get
>             {
>                 if(null != MessageId)
>                 {
>                     return MessageId.ProducerId.ConnectionId + ":" +
>                            MessageId.ProducerId.SessionId + ":" +
>                            MessageId.ProducerId.Value;
>                 }
>                 return String.Empty;
>             }
> {code}
> Suggested Fix: The sequenceID should be added back to the MessageId in the above get
method unless I am not seeing other potential problems. 
> Better Approach: As a side note, with this approach NMS can't be used with any other
message queue because the current implementation would force the other queues to construct
their unique message ids the same exact way. In bound messages should be void of any message
id formatting.  
> Steve

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


Mime
View raw message