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

clebert suconic commented on PROTON-694:
----------------------------------------

The previous version would do this:


        ProtonJMessage amqp = (ProtonJMessage) 
org.apache.qpid.proton.message.Message.Factory.create(header, da, ma, props, 
ap, body, footer);

        ByteBuffer buffer = ByteBuffer.wrap(new byte[1024*4]);
        final DroppingWritableBuffer overflow = new DroppingWritableBuffer();
        int c = amqp.encode(new CompositeWritableBuffer(new 
WritableBuffer.ByteBufferWrapper(buffer), overflow));
        if( overflow.position() > 0 ) {
            buffer = ByteBuffer.wrap(new byte[1024*4+overflow.position()]);
            c = amqp.encode(new WritableBuffer.ByteBufferWrapper(buffer));
        }

        return new EncodedMessage(messageFormat, buffer.array(), 0, c);



after my patch I'm doing the conversion on a sub method and then doing this 
existent conversion at the caller method.

I intend to call the version that won't be doing this final conversion. 

> splitting contrib/JMSMappingOutboundTransformer's encoding and transformation
> -----------------------------------------------------------------------------
>
>                 Key: PROTON-694
>                 URL: https://issues.apache.org/jira/browse/PROTON-694
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: clebert suconic
>
> I just need the transformation from this method, not the actual encoding.
> I need to later encode the ProtonJMessage using NettyBuffer which is pooled 
> and more efficient than the method done within JMSMappingOutboundTransformer.



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

Reply via email to