camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: Best strategy to by example authenticate a user based on file content before to process it ?
Date Wed, 09 Jul 2008 16:03:04 GMT
Hi

Sidenote: You can use interceptors to intercept the route and do the authentication and if
rejected divert the route to rejected queue.
But your approach is just as good. 

The transaction stuff is to my knowledge only for transactional resources such as JMS, JDBC.
It is Spring that has the honor of doing the hard work, so whatever Spring can manage for
transactions you can do.

The file component is not transaction aware to my knowledge = Spring does not manage it. But
the file component does indeed check if the exchange has failed or not. It's been a while
since I last peeked into the file component. We have target improvements for the File and
FTP components for Camel 1.5 as they could use a little overhaul in some areas.

You could read the file and put it on a JMS queue ASAP. Then you can have transaction spanning
as long as you want. 



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: cmoulliard [mailto:cmoulliard@gmail.com] 
Sent: 9. juli 2008 10:42
To: camel-user@activemq.apache.org
Subject: Best strategy to by example authenticate a user based on file content before to process
it ?


Hi,

I try to figure out what is the best strategy to by example authenticate a
user based on file content before to process the content of the file ?

The authentication process itself is not really important and may be
replaced by another logic (like validation, ....).

I'm not sure at all that I can do the full process in one route and probably
that I need to separate the part extracting the user of the file from the
next part of the route. Correct if I'm wrong ?

Idea :

from("file:///c:/temp")
.setProperty("userName").xpath("path to find in the XML file the username")
.to("direct:Authenticate");

from("direct:Authenticate")
.to("bean:authentication")
.choice().when(header("authenticated").isEqualTo(true)).to("direct:Unmarshallfile")
.otherwise.to("queue:rejectedMessage")

from("direct:UnmarshallFile")
.unmarshall().jaxb()
.to("queue:deliveredQueue")

Additional question : Can I place the three from ... to in one transaction ?

Regards,

Charles


-- 
View this message in context: http://www.nabble.com/Best-strategy-to-by-example-authenticate-a-user-based-on-file-content-before-to-process-it---tp18356949s22882p18356949.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message