Caused by: java.lang.IllegalStateException: java.io.IOException: Not enough available space for writing 61 bytes at net.openhft.lang.io.AbstractBytes.writeObject(AbstractBytes.java:2091) at tradetest.model.OrderCreateResponse.writeExternal(OrderCreateResponse.java:98) at net.openhft.lang.io.serialization.impl.ExternalizableMarshaller.write(ExternalizableMarshaller.java:50) at net.openhft.lang.io.serialization.impl.ExternalizableMarshaller.write(ExternalizableMarshaller.java:33) at net.openhft.lang.io.serialization.BytesMarshallableSerializer.writeSerializable(BytesMarshallableSerializer.java:97) at net.openhft.lang.io.AbstractBytes.writeObject(AbstractBytes.java:2089) ... 11 moreCaused by: java.io.IOException: Not enough available space for writing 61 bytes at net.openhft.lang.io.view.BytesOutputStream.checkAvailable(BytesOutputStream.java:85) at net.openhft.lang.io.view.BytesOutputStream.write(BytesOutputStream.java:99) at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:253) at java.util.zip.DeflaterOutputStream.finish(DeflaterOutputStream.java:226) at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238) at java.io.ObjectOutputStream$BlockDataOutputStream.close(ObjectOutputStream.java:1827) at java.io.ObjectOutputStream.close(ObjectOutputStream.java:741) at net.openhft.lang.io.serialization.JDKZObjectSerializer.writeSerializable(JDKZObjectSerializer.java:40) at net.openhft.lang.io.serialization.BytesMarshallableSerializer.writeSerializable(BytesMarshallableSerializer.java:102) at net.openhft.lang.io.AbstractBytes.writeObject(AbstractBytes.java:2089) ... 16 more
class OrderCreateResponse implements Externalizable {
private List<TradeClosed> tradesClosed;
//other fields
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(code); out.writeLong(unixTimeSec);
//do not serialize the List, just its content
//out.writeObject(tradesClosed);
out.writeInt(tradesClosed.size()); for (TradeClosed tc : tradesClosed) { out.writeObject(tc); }
}
try { appender.startExcerpt(512); appender.writeUTFΔ(obj.getAccountId()); appender.writeObject(obj); appender.finish();} catch(Exception any) { logger.log(Level.WARNING, String.format("Exception in appender: %s", any.getMessage()), any);}
The intent is that you provide the size if you know what it is likely to be, otherwise I suggest not providing it.
Try instead
appender.startExcerpt();
--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
int cycleLength = (int)TimeUnit.DAYS.toMillis(7);//604800000 ms == 1 wk
chronicle = ChronicleQueueBuilder.vanilla(adapterDescriptor.getQueueBasePath()) .cycleLength(cycleLength, true) .defaultMessageSize(1024) .dataBlockSize(1024L << 20)//1024 MB .indexBlockSize(256L << 20)//256 MB .build();