@Override public void storeContent() { if (dataOut != null) { try { dataOut.close(); ByteSequence bs = bytesOut.toByteSequence(); setContent(bs); ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { doCompress(); } } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } finally { try { if (bytesOut != null) { bytesOut.close(); bytesOut = null; } if (dataOut != null) { dataOut.close(); dataOut = null; } } catch (IOException ioe) { } } } }
@JmsListener(destination = "mytopic") public void processMessage(BytesMessage message) { ActiveMQBytesMessage msg = (ActiveMQBytesMessage) message; ActiveMQConnection conn = msg.getConnection(); ConnectionInfo info = conn.getConnectionInfo(); String username = info.getUserName(); }
@Override public void storeContent() { if (dataOut != null) { try { dataOut.close(); ByteSequence bs = bytesOut.toByteSequence(); setContent(bs); ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { doCompress(); } } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } finally { try { if (bytesOut != null) { bytesOut.close(); bytesOut = null; } if (dataOut != null) { dataOut.close(); dataOut = null; } } catch (IOException ioe) { } } } }
this.bytesOut = new ByteArrayOutputStream(); OutputStream os = bytesOut; ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) {
@Override public void storeContent() { if (dataOut != null) { try { dataOut.close(); ByteSequence bs = bytesOut.toByteSequence(); setContent(bs); ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { doCompress(); } } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } finally { try { if (bytesOut != null) { bytesOut.close(); bytesOut = null; } if (dataOut != null) { dataOut.close(); dataOut = null; } } catch (IOException ioe) { } } } }
@Override public void storeContent() { if (dataOut != null) { try { dataOut.close(); ByteSequence bs = bytesOut.toByteSequence(); setContent(bs); ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { doCompress(); } } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } finally { try { if (bytesOut != null) { bytesOut.close(); bytesOut = null; } if (dataOut != null) { dataOut.close(); dataOut = null; } } catch (IOException ioe) { } } } }