java - Huge Storage for Weblogic JMS Server -
in weblogic server (4 nodes) defined migratable jms server (oracle) database storage. here receive 1000 messages per second. every message xml message of 1kb.
i might have need stop java mdb 1 day , store several gb of data (due maintenance).
how can (with little overhead) save these messages compressed in order reduce space?
there 2 possibilities, speaking main idea compress data:
- compress message: suggested oracle
- compress tablespace; not suggetsed oracle
then let me suggest first solution; then, can enable weblogic compression or custom compression on producer , consumer.
weblogic compression
navigate jms connection factory -> click configuration > default delivery tab. on default delivery page -> default compression threshold
custom gzip compression
- compress xml message before sending
- uncompress when receive
for instance use following code on mdb extract text if producer compressed message or not;
protected string gettext(message message) throws jmsexception, ioexception { if (message instanceof textmessage) { return ((textmessage) message).gettext(); } else if (message instanceof bytesmessage) { byte zipped[] = new byte[(int) ((bytesmessage) message) .getbodylength()]; ((bytesmessage) message).readbytes(zipped); bytearrayinputstream bais = new bytearrayinputstream(zipped); stringbuilder sb = null; gzipinputstream in = null; try { in = new gzipinputstream(bais); bufferedreader reader = new bufferedreader( new inputstreamreader(in)); sb = new stringbuilder(); string line = null; while ((line = reader.readline()) != null) { sb.append(line); } } { try { if (in != null) in.close(); } catch (ioexception e) { log.error("gettext: ", e); } try { if (bais != null) bais.close(); } catch (ioexception e) { log.error("gettext: ", e); } } return sb.tostring(); } else { throw new jmsexception("unrecognized message type " + message.getclass()); } }
custom exi compression
recently evalued efficient xml interchange (exi) format 1.0. here indicators:
- original message: 8903b
- gzipped message: 1212b
- exi schemaless: 903b
- exi schema: 856b
but java open source implementation exi proxessor proposed siemens
Comments
Post a Comment