From dev-return-64776-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Thu Mar 22 18:02:59 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 66A42180676 for ; Thu, 22 Mar 2018 18:02:58 +0100 (CET) Received: (qmail 29306 invoked by uid 500); 22 Mar 2018 17:02:57 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 29289 invoked by uid 99); 22 Mar 2018 17:02:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2018 17:02:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 94875F4E52; Thu, 22 Mar 2018 17:02:56 +0000 (UTC) From: franz1981 To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request #1970: Artemis 1765 Large Mesasge fixes betwee... Content-Type: text/plain Message-Id: <20180322170256.94875F4E52@git1-us-west.apache.org> Date: Thu, 22 Mar 2018 17:02:56 +0000 (UTC) Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1970#discussion_r176497842 --- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java --- @@ -213,6 +218,63 @@ public ActiveMQBuffer getReadOnlyBodyBuffer() { return new ChannelBufferWrapper(buffer.slice(BODY_OFFSET, endOfBodyPosition - BUFFER_HEADER_SPACE).setIndex(0, endOfBodyPosition - BUFFER_HEADER_SPACE).asReadOnly()); } + /** + * This will return the proper buffer to represent the data of the Message. If compressed it will decompress. + * If large, it will read from the file or streaming. + * @return + * @throws ActiveMQException + */ + @Override + public ActiveMQBuffer getDataBuffer() { + + ActiveMQBuffer buffer; + + try { + if (isLargeMessage()) { + LargeBodyEncoder encoder = getBodyEncoder(); --- End diff -- would be better to pack the uncommon path into a separate method ---