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 DDDD9D389 for ; Mon, 4 Feb 2013 21:57:15 +0000 (UTC) Received: (qmail 78622 invoked by uid 500); 4 Feb 2013 21:57:15 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 78540 invoked by uid 500); 4 Feb 2013 21:57:15 -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 78529 invoked by uid 99); 4 Feb 2013 21:57:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 21:57:15 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 21:57:09 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1U2U1x-0001Bv-4m for users@camel.apache.org; Mon, 04 Feb 2013 13:56:49 -0800 Date: Mon, 4 Feb 2013 13:56:49 -0800 (PST) From: dvsridhar To: users@camel.apache.org Message-ID: <1360015009142-5726923.post@n5.nabble.com> Subject: calling camel route from a Servlet Filter MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, We have some security filters that's get executed even before the request reaches the actual end point. We need to log failed security attempts as part of the audit log. We have some central audit log routes that already does audit logging. What is the best way to invoke a route from a servlet filter. I tried 2 ways and I got Nullpointer exception both the cases. *Approach 1:* @EndpointInject(uri="jms:queue:com/cgi/fdx/route/audit_log_queue") private ProducerTemplate producer; . . producer.sendBody(log); *Approach 2* @Produce(uri = "jms:queue:com/cgi/fdx/route/audit_log_queue") private AuditProxy audit; . . audit.audit(log); *Audit Porxy Interface ------------- * import java.io.Serializable; import org.apache.camel.InOnly; @InOnly public interface AuditProxy extends Serializable{ public void audit(AuditLog log); } Thanks, Sridhar -- View this message in context: http://camel.465427.n5.nabble.com/calling-camel-route-from-a-Servlet-Filter-tp5726923.html Sent from the Camel - Users mailing list archive at Nabble.com.