camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvsridhar <dabbeeru.venkata.srid...@cgifederal.com>
Subject calling camel route from a Servlet Filter
Date Mon, 04 Feb 2013 21:56:49 GMT
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.

Mime
View raw message