Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 66529 invoked from network); 28 Apr 2009 16:28:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Apr 2009 16:28:08 -0000 Received: (qmail 5270 invoked by uid 500); 28 Apr 2009 16:28:07 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 5207 invoked by uid 500); 28 Apr 2009 16:28:07 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 5197 invoked by uid 500); 28 Apr 2009 16:28:07 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 5194 invoked by uid 99); 28 Apr 2009 16:28:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 16:28:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 16:27:59 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 24B75234C045 for ; Tue, 28 Apr 2009 09:27:38 -0700 (PDT) Message-ID: <363947950.1240936058141.JavaMail.jira@brutus> Date: Tue, 28 Apr 2009 09:27:38 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-1563) Message - getOut, getFault should not create empty message if none exists In-Reply-To: <1890042062.1240552178069.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51425#action_51425 ] Claus Ibsen commented on CAMEL-1563: ------------------------------------ What if we add: - {getOrCreateOut} - {getOrCreateFault} Wouldn't that help understand the problem and migrate to a getOut that can return {null} if no out exists. So the newbie problem that Roman highlighted can be avoided. Its sure is hard to find the lost header or body if you added some system out for a little logging. The big concern would be if the change would break to much for existing users doing upgrades. What does the community think? > Message - getOut, getFault should not create empty message if none exists > ------------------------------------------------------------------------- > > Key: CAMEL-1563 > URL: https://issues.apache.org/activemq/browse/CAMEL-1563 > Project: Apache Camel > Issue Type: Improvement > Components: camel-core > Affects Versions: 2.0-M1 > Reporter: Claus Ibsen > Assignee: Claus Ibsen > Fix For: 2.0.0 > > > The getOut and getFault methods on org.apache.camel.Message creates a new empty object if none exists already. > This confuses end users when they use the methods in their custom processors. > We should instead add hasOut, hasFault methods that can be used for checking if it exists or not. > *Note:* The getOut(false) can be used to not create a new message if none exists but its really not adhering to good java beans standard. > See nabble: > http://www.nabble.com/Payload-Gets-Nulled-Out-td23105477.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.