skyscreamer / nevado

A JMS driver for Amazon SQS.
http://nevado.skyscreamer.org/
Apache License 2.0
51 stars 48 forks source link

Non-nevado topic messages are not being cleaned up #85

Open carterpage opened 10 years ago

carterpage commented 10 years ago

The implementation checks if the destination is of type NevadoTopic before it deletes the message. It should probably check that it is "Topic" in case it is a non-Nevado topic.

public class NevadoSession implements Session {
 .......
 protected NevadoMessage receiveMessage(NevadoDestination destination, long timeoutMs, boolean noLocal)
            throws JMSException, InterruptedException {

       …….

        // Filter noLocal matches
 line 437:  if (message != null && destination instanceof NevadoTopic && noLocal && _connection.getConnectionID()
                .equals(message.getNevadoProperty(NevadoProperty.ConnectionID)))
        {
            deleteMessage(message);
            message = null;
        }
    }

   ……..
}

.....

}

carterpage commented 10 years ago

Unable to reproduce. Whenever NevadoSession creates a consumer or a producer with a foreign implementation of a Destination, it will transform it into a NevadoDestination using NevadoDestination.getInstance(destination);