You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Christopher L. Shannon (Jira)" <ji...@apache.org> on 2021/06/14 11:31:00 UTC

[jira] [Closed] (AMQ-8299) ActiveMQMapMessage data corruption- should use LinkedHashMap to preserve original order

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

Christopher L. Shannon closed AMQ-8299.
---------------------------------------
    Resolution: Invalid

It's a Map, the whole point is there is no ordering..it's key/value pairs and not a list or something like that so there is no bug here or corruption. There's no guarantee of order with a map so there's no reason to change anything.

Look at: [https://docs.oracle.com/javaee/7/api/javax/jms/MapMessage.html]
{quote}A MapMessage object is used to send a set of name-value pairs. The names are String objects, and the values are primitive data types in the Java programming language. The names must have a value that is not null, and not an empty string. The entries can be accessed sequentially or randomly by name. *The order of the entries is undefined.* MapMessage inherits from the Message interface and adds a message body that contains a Map.
{quote}

> ActiveMQMapMessage data corruption- should use LinkedHashMap to preserve original order
> ---------------------------------------------------------------------------------------
>
>                 Key: AMQ-8299
>                 URL: https://issues.apache.org/jira/browse/AMQ-8299
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.16.2
>            Reporter: Piotr Klimczak
>            Priority: Major
>
> The core principle of messaging system is that payload sent by producer is received exactly same (unmodified) on consumer side.
> However due to ActiveMQMapMessage using HashMap for map data, the order of entries is not guaranteed effectively causing data corruption.
>  This is especially true when we are sending LinkedHashMap on producer side. Then the consumer side will receive out of order data.
> This is not newly introduced bug, looks like it is there for many years- surprisingly.
> From what I have seen in client implementation, it is perfectly ready to work with LinkedHashMap. So it might be just one line change to fix + test coverage.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)