Obviously it is changing, but only the fileName - but shouldn't this be perfectly valid or am I misusing it?
ankelee wrote: > > Isn't recipientList overkill for this? The endpoint is not dynamically > changing during runtime. It's just resolved at route creation. > > In Java DSL I do as such: > > .wireTap("file://" + props.getProperty("directory.incoming.backup") + > "?fileName=${in.header.backupFileName}") > > > > Claus Ibsen-2 wrote: >> >> On Wed, May 19, 2010 at 5:41 PM, ankelee <andreasasm...@gmail.com> wrote: >>> >>> Hi >>> >>> How can I make it validate not online? >>> >>> I tried loading the properties as such: >>> >>> <bean id="properties" >>> class="org.apache.camel.component.properties.PropertiesComponent"> >>> <property name="location" >>> value="classpath:com/mycompany/myprop.properties"/> >>> </bean> >>> >>> Now I can access them using the {{}} syntax which is fine, but I can't >>> use >>> them for URI's right? >>> <from uri="{{directory.incoming}}" /> >>> >>> Instead I should do as so: >>> <endpoint id="incoming.inbox" uri="file:{{directory.incoming}}"/> >>> >>> >>> Thats ok except that I in some cases need to use header information as >>> part >>> as an endpoint configuration. Which Camel seems to fail at - I would >>> like >>> something as such: >>> >> >> Use the recipient list EIP pattern for that, where endpoints is >> computed at runtime with data from the messages coming into the >> recipient list EIP. >> >> >>> <endpoint id="outgoing.backup" >>> uri="file:{{directory.incoming.backup}}?fileName=${in.header.envelopeId}.ack"/> >>> >>> Do I need use the trick at this site: >>> http://cmoulliard.blogspot.com/2009/05/trick-to-pass-uri-declared-in-property.html >>> >>> Also: >>> "From Camel 2.3 onwards there is a Properties component build in Camel >>> core >>> which allows you to use properties in the same way as Spring property >>> placeholders, and even more." >>> >>> >>> >>> ankelee wrote: >>>> >>>> Trying to use this new feature using 2.3.0-SNAPSHOT. >>>> >>>> <camelContext xmlns="http://camel.apache.org/schema/spring"> >>>> <propertyPlaceholder id="properties" >>>> location="com/mycompany/myprop.properties"/> >>>> ..... >>>> >>>> Error: >>>> >>>> org.springframework.beans.factory.parsing.BeanDefinitionParsingException: >>>> Configuration problem: Failed to import bean definitions from relative >>>> location [default-camel.xml] >>>> Offending resource: class path resource [isuite-client-context.xml]; >>>> nested exception is >>>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: >>>> Line 35 in XML document from class path resource [default-camel.xml] is >>>> invalid; nested exception is org.xml.sax.SAXParseException: >>>> cvc-complex-type.2.4.a: Invalid content starting with element >>>> 'propertyPlaceholder'. One of >>>> '{"http://camel.apache.org/schema/spring":endpoint, >>>> "http://camel.apache.org/schema/spring":dataFormats, >>>> "http://camel.apache.org/schema/spring":onException, >>>> "http://camel.apache.org/schema/spring":onCompletion, >>>> "http://camel.apache.org/schema/spring":intercept, >>>> "http://camel.apache.org/schema/spring":interceptFrom, >>>> "http://camel.apache.org/schema/spring":interceptSendToEndpoint, >>>> "http://camel.apache.org/schema/spring":route}' is expected. >>>> at >>>> org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) >>>> at >>>> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) >>>> at >>>> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) >>>> >>>> What could be the problem? >>>> >>>> On another note, the site http://camel.apache.org/properties.html is >>>> confusing. >>>> "Camel now provides a new PropertiesComponent in camel-core which >>>> allows >>>> you to use property placeholders when defining Camel Endpoint URIs. >>>> This works much like you would do if using Spring's >>>> <property-placeholder> >>>> tag. However Spring have a limitation which prevents 3rd party >>>> frameworks >>>> to leverage Spring property placeholders to the fullest." >>>> >>>> And then it links to a trick to show how to use properties as >>>> endpoints. >>>> >>>> So can I use {{prop.prop}} as URI or not? >>>> >>> >>> -- >>> View this message in context: >>> http://old.nabble.com/%3CpropertyPlaceholder%3E-not-working.-tp28609051p28610107.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Author of Camel in Action: http://www.manning.com/ibsen/ >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> > > -- View this message in context: http://old.nabble.com/%3CpropertyPlaceholder%3E-not-working.-tp28609051p28618633.html Sent from the Camel - Users mailing list archive at Nabble.com.