tabish121 commented on PR #1284:
URL: https://github.com/apache/activemq/pull/1284#issuecomment-2302514843

   > @tabish121 - Do you have any thoughts on this PR (or know who else would 
know?)
   > 
   > I'm not too familiar with the UTF-8 encoding stuff or the history of why 
we custom rolled the encoding. Obviously changing anything with the encoding 
utility is a high risk change so I want to make sure we don't break things (ie 
make sure we can still read old stuff stored in KahaDB as i think it uses the 
same utilities).
   
   I think one reason that a custom versions was created is that there isn't 
any tooling in the JDK to get the encoded size without actually encoding it, 
which requires a buffer sized to the expected output encoding size so to allow 
the openwire encoder to not have to guess (possibly more than once) the code 
was created.  We do something similar in the AMQP codec in proton-j for this 
same reason. I think the broker uses this API everywhere an openwire message 
has its string encoded or decoded so it should be safe but I guess you might 
need to audit that to be certain.
   
   At a glance the changes seem okay, although it has been awhile since I did 
this sort of thing.  
   
   > 
   > I'm open to either using the changes here or the JDK implementation if we 
can get that to work (like I quickly added a test in my branch 
[cshannon@e68021d](https://github.com/cshannon/activemq/commit/e68021d33bbc1396d7e72083ee17fd00b620e374)
 , although it's not quite workign all the way as i noted). The main thing is 
making sure it's correct and we don't introduce a bug
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to