activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: sizePrefixDisabled and/or maxFrameSize change in AcriveMq 5.6 broke FilePendingMessageCursor for big messages
Date Tue, 25 Sep 2012 10:12:00 GMT
I can't think of a workaround save the use the VM Cursor so there is
no marshalling, but the internal usage of marshallers should not
impose a limit on the message size, that should be left to the
transports which accept the messages in the first place.

Please raise a jira issue and we will try and resolve for 5.7, this is
a blocker.

On 25 September 2012 09:36, yazun <yazuna@gmail.com> wrote:
> Hello,
> We rely on the Camel file component to publish rather largish files as
> messages (>100MB) using FileCursor. It used to work well (in pre 5.6 I
> think) but now it is impossible to publish anything larger due to the fact
> that even it is possible to set sizePrefixDisabled and maxFrameSize for the
> OpenWire negotiation properly, so the publishing works -  it is not possible
> to fetch or browse such messages as FilePendingMessageCursor.getMessage()
> calls OpenWireFormat.unmarshal(ByteSequence) with default values (of
> maxFrameSize i.e.) set, resulting in exception thrown from here:
>
>   public synchronized Object unmarshal(ByteSequence sequence) throws
> IOException {
>         bytesIn.restart(sequence);
>         // DataInputStream dis = new DataInputStream(new
>         // ByteArrayInputStream(sequence));
>
>         if (!sizePrefixDisabled) { <------this is always false when called
> via Queue.doPageInForDispatch() or expireMessages and maybe few other calls
>             int size = bytesIn.readInt();
>             if (sequence.getLength() - 4 != size) {
>                 // throw new IOException("Packet size does not match
> marshaled
>                 // size");
>             }
>
>             if (size > maxFrameSize) { <---- this is always 100MB
>                 throw new IOException("Frame size of " + (size / (1024 *
> 1024)) + " MB larger than max allowed " + (maxFrameSize / (1024 * 1024)) + "
> MB");
>             }
>         }
>
>         Object command = doUnmarshal(bytesIn);
>         // if( !cacheEnabled && ((DataStructure)command).isMarshallAware() )
> {
>         // ((MarshallAware) command).setCachedMarshalledForm(this,
> sequence);
>         // }
>         return command;
>     }
>
> I understand maxFrameSize was introduced to prevent DOS attacks - but it
> simply does not work as the negotiated values are not recalled when fetching
> the messages from the store.
> Should we create a bug report? or reopen
> https://issues.apache.org/jira/browse/AMQ-498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ?
> Anybody knows a workaround?
> Cheers,
> Krzysztof
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/sizePrefixDisabled-and-or-maxFrameSize-change-in-AcriveMq-5-6-broke-FilePendingMessageCursor-for-bigs-tp4656898.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com

Mime
View raw message