[ 
https://issues.apache.org/jira/browse/ARTEMIS-4931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17868380#comment-17868380
 ] 

ASF subversion and git services commented on ARTEMIS-4931:
----------------------------------------------------------

Commit 8d1a66fbbd4a5eef3728b53ed772678a42772630 in activemq-artemis's branch 
refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=8d1a66fbbd ]

ARTEMIS-4931 fix bridge config encoding

This commit fixes 3 distinct issues with bridge configuration encoding:

 - The encoding size was calculated incorrectly in three ways:
   - Using 0 instead of `DataConstants.SIZE_NULL` when no transformer is
     defined resulting in a calculated size discrepancy of -1.
   - Using `DataConstants.INT` instead of `DataConstants.SIZE_INT` for
     the number of transformer properties resulting in a calculated size
     discrepancy of +2 when using a configuration with a transformer.
   - Using 0 or `sizeOfNullableInteger` instead of
     `DataConstants.SIZE_INT` for the number of static connectors
     resulting in a variable calculated size discrepancy of either -4 or
     +1 respectively.
 - Encoding was using `writeString` instead of `writeNullableString` for
   the name of the transformer class resulting in an actual buffer size
   discrepancy of -1.

Aside from these fixes this commit also adds new tests specifically for
encoding & decoding include a test to verify known bytes during
encoding.

Lastly, it's worth noting that this *won't fix* bad data that was
already stored to disk by an older broker or bad data that comes over
the wire from an older broker (e.g. if a older primary broker paired
with a newer backup).


> BridgeConfiguration encoding is broken
> --------------------------------------
>
>                 Key: ARTEMIS-4931
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4931
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to