-
1. Re: Reading xbean.xml Property Values from JDNI Resource
stlewis Jun 5, 2009 11:51 AM (in response to terrancecrow)It sounds like what you want to do here (retrieve e-mails and store the incoming e-mail addresses in a DB) might be better suited to a camel route using camel-mail and then maybe camel-ibatis to write the data into the DB. You could deploy this then as an SA in servicemix.
-
2. Re: Reading xbean.xml Property Values from JDNI Resource
terrancecrow Jun 5, 2009 12:40 PM (in response to stlewis)Thank you very much for your reply.
I apologize, because it looks like I didn't state my question clearly.
What I need to do is retrieve an xbean.xml property value from an JNDI data source.
To use a specific example: Let's say I need to connect to an FTP server. Consider this segment from an FTP endpoint's xbean.xml file:
<ftp:sender service="replaceMe:withYourService"
endpoint="endpoint"
targetService="replaceMe:receiver"
uri="ftp://servicemix:rocks@localhost/smx/test" />
I'd like to store the rocks@localhost (along with its password, which doesn't really show up in the example) in a JNDI data resource. That way, if the ID/passwords changes, I can give non technical staff a UI to simply change the value in the table, and the FTP service unit will continue to operate.
Does that make sense? Am I even looking at the problem in the right way?
Thank you again for your response.
-
3. Re: Reading xbean.xml Property Values from JDNI Resource
stlewis Jun 5, 2009 2:15 PM (in response to terrancecrow)Hmmm, the closest thing I can see to your use case is to use a PropertyPlaceholderConfigurer:
This will let you at least specify these values without having to modify the xbean.xml. At the moment though even if you change the properties file pointed to by "location" the changes won't get picked up until the SA is re-deployed, as the xbean.xml file is only consulted at deployment time. Hope that gets you going in the right direction at least!
-
4. Re: Reading xbean.xml Property Values from JDNI Resource
stlewis Jun 5, 2009 2:32 PM (in response to stlewis)Look at that, looks like you can use this to specify a .properties file in JNDI if it helps: http://forum.springsource.org/showthread.php?t=14361
-
5. Re: Reading xbean.xml Property Values from JDNI Resource
terrancecrow Jun 5, 2009 2:51 PM (in response to stlewis)Thanks for the tip on properties files -- that might be what I need. I'll try that this weekend.
Thanks again!
-
6. Re: Reading xbean.xml Property Values from JDNI Resource
terrancecrow Jun 8, 2009 1:58 PM (in response to stlewis)I'm afraid I didn't get a chance to test this over the weekend, but I'll give it a shot as soon as I can. In the meantime, I'm going to mark the question closed, because I think the solution will work.
Thanks again for your help!