Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1C7F177B0 for ; Tue, 17 Feb 2015 18:35:14 +0000 (UTC) Received: (qmail 63273 invoked by uid 500); 17 Feb 2015 18:35:13 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 63235 invoked by uid 500); 17 Feb 2015 18:35:13 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 62895 invoked by uid 99); 17 Feb 2015 18:35:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 18:35:13 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of mark.mindenhall@machineshop.io does not designate 157.56.110.130 as permitted sender) Received: from [157.56.110.130] (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.110.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 18:35:06 +0000 Received: from BY1PR0601MB1192.namprd06.prod.outlook.com (25.161.204.153) by BY1PR0601MB1191.namprd06.prod.outlook.com (25.161.204.152) with Microsoft SMTP Server (TLS) id 15.1.81.19; Tue, 17 Feb 2015 18:34:42 +0000 Received: from BY1PR0601MB1192.namprd06.prod.outlook.com ([25.161.204.153]) by BY1PR0601MB1192.namprd06.prod.outlook.com ([25.161.204.153]) with mapi id 15.01.0081.018; Tue, 17 Feb 2015 18:34:42 +0000 From: Mark Mindenhall To: "users@camel.apache.org" Subject: camel-netty4-http access to response Thread-Topic: camel-netty4-http access to response Thread-Index: AQHQSuBk3oadI+tA5EGT5hkO77fskQ== Date: Tue, 17 Feb 2015 18:34:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [24.8.227.85] authentication-results: camel.apache.org; dkim=none (message not signed) header.d=none; x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1191; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1191; x-forefront-prvs: 0490BBA1F0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(164054003)(50986999)(87936001)(2501002)(83716003)(2656002)(54356999)(102836002)(40100003)(450100001)(230783001)(19580395003)(110136001)(122556002)(74482002)(82746002)(86362001)(106116001)(229853001)(2351001)(36756003)(77156002)(62966003)(46102003)(2900100001)(66066001)(99286002)(92566002)(107886001)(33656002)(104396002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1191;H:BY1PR0601MB1192.namprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: machineshop.io X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Feb 2015 18:34:42.0044 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 26c62758-7f1e-42bb-a5d7-d3744187d817 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1191 X-Virus-Checked: Checked by ClamAV on apache.org I=92m using the camel-netty4-http (latest 2.14.2-SNAPSHOT) component to cre= ate an endpoint that receives an HTTP POST from a device, translates the me= ssage from binary to JSON, then sends it along to a kafka topic for further= processing. When there are errors in validating or translating the incomi= ng message, I need to be able to return a HTTP response code and response b= ody. The camel-netty4-http documentation has an =93Access to Netty types=94 sect= ion, which says that I should be able to do the following to access the ins= tance of io.netty.handler.codec.http.HttpResponse: HttpResponse response =3D exchange.getIn(NettyHttpMessage.class).getHt= tpResponse(); Regardless of where I access the exchange within the route, getHttpResponse= () is always returning null. On the "happy path=94 I can return 200 by cal= ling exchange.getOut().setBody(myResponse), but I have been unable to figur= e out how to return another response code. Is this a bug? Or is there another way to accomplish what I=92m trying to = do? Thanks, Mark