activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yazun <yaz...@gmail.com>
Subject sizePrefixDisabled and/or maxFrameSize change in AcriveMq 5.6 broke FilePendingMessageCursor for big messages
Date Tue, 25 Sep 2012 08:36:33 GMT
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.

Mime
View raw message