activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Probst (JIRA)" <jira+amq...@apache.org>
Subject [jira] [Updated] (AMQNET-514) Lazy loading of map messages does not work correctly
Date Tue, 08 Dec 2015 09:31:11 GMT

     [ https://issues.apache.org/jira/browse/AMQNET-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oliver Probst updated AMQNET-514:
---------------------------------
    Description: 
I use Apache NMS ActiveMQ together with Spring NMS and map messages. I use two persistent
queues. Dequeuing without accessing the message and then queuing the same message again results
in a removal of the complete body of the map message. The use case is that we move a map message
to an error queue if an exception occurs while dequeuing. I've got a unit test which shows
the behaviour with one persistent queue (queue=>dequeue=>queue=>dequeue):

[Test]
public void QueueDequeueQueueDequeueTest()
{
            IConnectionFactory factory = CreateConnectionFactory();
            var nmsTemplate = new NmsTemplate(factory) { ReceiveTimeout = 5000 };
            // Queue
            nmsTemplate.SendWithDelegate("queue://FOO.BAR", delegate(ISession session)
            {
                var mapMessage = session.CreateMapMessage();
                mapMessage.Body.SetString("Unit-Test-Key", "Unit-Test-Value");
                return mapMessage;
            });
            // Dequeue
            var currentMessage = nmsTemplate.Receive("queue://FOO.BAR") as IMapMessage;
            Assert.IsNotNull(currentMessage, "currentMessage is null");
            // Queue
            IMapMessage message = currentMessage;
            nmsTemplate.SendWithDelegate("queue://FOO.BAR", session => message);
            Assert.IsNotNull(currentMessage, "currentMessage is null");
            // Dequeue
            currentMessage = nmsTemplate.Receive("queue://FOO.BAR") as IMapMessage;
            Assert.IsNotNull(currentMessage, "currentMessage is null");
            Assert.IsTrue(currentMessage.Body.Contains("Unit-Test-Key"), "Unit-Test-Key does
not exist");
        }

  was:
I use Apache NMS ActiveMQ together with Spring NMS and map messages. I use two persistent
queues. Dequeuing without accessing the message and then queuing the same message again results
in a removal of the complete body of the map message. The use case is that we move a map message
to an error queue if an exception occurs while dequeuing. I've got a unit test which shows
the behaviour with one persistent queue (queue=>dequeue=>queue=>dequeue):

 [Test]
        public void QueueDequeueQueueDequeueTest()
        {
            IConnectionFactory factory = CreateConnectionFactory();
            var nmsTemplate = new NmsTemplate(factory) { ReceiveTimeout = 5000 };
            // Queue
            nmsTemplate.SendWithDelegate("queue://FOO.BAR", delegate(ISession session)
            {
                var mapMessage = session.CreateMapMessage();
                mapMessage.Body.SetString("Unit-Test-Key", "Unit-Test-Value");
                return mapMessage;
            });
            // Dequeue
            var currentMessage = nmsTemplate.Receive("queue://FOO.BAR") as IMapMessage;
            Assert.IsNotNull(currentMessage, "currentMessage is null");
            // Queue
            IMapMessage message = currentMessage;
            nmsTemplate.SendWithDelegate("queue://FOO.BAR", session => message);
            Assert.IsNotNull(currentMessage, "currentMessage is null");
            // Dequeue
            currentMessage = nmsTemplate.Receive("queue://FOO.BAR") as IMapMessage;
            Assert.IsNotNull(currentMessage, "currentMessage is null");
            Assert.IsTrue(currentMessage.Body.Contains("Unit-Test-Key"), "Unit-Test-Key does
not exist");
        }


> Lazy loading of map messages does not work correctly
> ----------------------------------------------------
>
>                 Key: AMQNET-514
>                 URL: https://issues.apache.org/jira/browse/AMQNET-514
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: ActiveMQ, NMS
>    Affects Versions: 1.7.0, 1.7.1
>         Environment: Apache NMS 1.7.0.3635
> Apache NMS ActiveMQ 1.7.0.3660
> Runtime Version v4.0.30319
>            Reporter: Oliver Probst
>            Assignee: Jim Gomes
>            Priority: Critical
>              Labels: test
>
> I use Apache NMS ActiveMQ together with Spring NMS and map messages. I use two persistent
queues. Dequeuing without accessing the message and then queuing the same message again results
in a removal of the complete body of the map message. The use case is that we move a map message
to an error queue if an exception occurs while dequeuing. I've got a unit test which shows
the behaviour with one persistent queue (queue=>dequeue=>queue=>dequeue):
> [Test]
> public void QueueDequeueQueueDequeueTest()
> {
>             IConnectionFactory factory = CreateConnectionFactory();
>             var nmsTemplate = new NmsTemplate(factory) { ReceiveTimeout = 5000 };
>             // Queue
>             nmsTemplate.SendWithDelegate("queue://FOO.BAR", delegate(ISession session)
>             {
>                 var mapMessage = session.CreateMapMessage();
>                 mapMessage.Body.SetString("Unit-Test-Key", "Unit-Test-Value");
>                 return mapMessage;
>             });
>             // Dequeue
>             var currentMessage = nmsTemplate.Receive("queue://FOO.BAR") as IMapMessage;
>             Assert.IsNotNull(currentMessage, "currentMessage is null");
>             // Queue
>             IMapMessage message = currentMessage;
>             nmsTemplate.SendWithDelegate("queue://FOO.BAR", session => message);
>             Assert.IsNotNull(currentMessage, "currentMessage is null");
>             // Dequeue
>             currentMessage = nmsTemplate.Receive("queue://FOO.BAR") as IMapMessage;
>             Assert.IsNotNull(currentMessage, "currentMessage is null");
>             Assert.IsTrue(currentMessage.Body.Contains("Unit-Test-Key"), "Unit-Test-Key
does not exist");
>         }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message