Also, for what it's worth, I can stay at the currently supported version of
Camel we are using and do this:

                    <completionTimeout>

<simple>${properties:processor.posting.aggregation_timeout_millis}</simple>
                    </completionTimeout>

--sgp


On Mon, Aug 19, 2013 at 1:39 PM, Scott Parkerson <sc...@parkerson.net>wrote:

> Ah, but I see that I can use the completionTimeout as an attribute; I've
> tried it using the special namespace with 2.10.5 and it worked.
>
> Thanks!
>
> --sgp
>
>
> On Mon, Aug 19, 2013 at 1:32 PM, Scott Parkerson <sc...@parkerson.net>wrote:
>
>> Babak,
>>
>> I'm not sure this will help, as the value I'm trying to replace is not an
>> attribute, but a child element (see <completionTimeout> element below:
>>
>>
>>                 <aggregate aggregationRepositoryRef="aggregatorRepository"
>>
>> strategyRef="postingRequestResultAggregationStrategy">
>>                     <correlationExpression>
>>
>> <simple>${in.header.ATEB_CLIENT_ID}-${body.clientStoreId}-${body.rxNumber}-${in.header.ATEB_FILENAME_DATESTAMP}</simple>
>>                     </correlationExpression>
>>                     <completionPredicate>
>>                         <simple>${in.body.isComplete}</simple>
>>                     </completionPredicate>
>>                     <completionTimeout>
>>
>> <constant>{{processor.posting.aggregation_timeout_millis}}</constant>
>>                     </completionTimeout>
>>                     <filter>
>>                         <simple>${in.header.CamelAggregatedCompletedBy}
>> == 'timeout'</simple>
>>                         <log
>> logName="com.ateb.messaging.myx.posting_results.CamelRoutes"
>> loggingLevel="WARN" message="${in.header.CamelFileNameOnly}:
>> ${in.header.ATEB_CLIENT_ID}-${body.clientStoreId}-${body.rxNumber}-${in.header.ATEB_FILENAME_DATESTAMP}]
>> Timed out waiting for aggregation"/>
>>                         <stop />
>>                     </filter>
>>                     <to uri="bean:postResults" />
>>                 </aggregate>
>>
>> --sgp
>>
>>
>> On Mon, Aug 19, 2013 at 12:53 PM, Babak Vahdat <
>> babak.vah...@swissonline.ch> wrote:
>>
>>> Hi
>>>
>>> Can you try upgrading to 2.10.5, see the blue box here about the xs:int
>>> type
>>> attribute when OSGi Blueprint is in use:
>>>
>>>
>>> http://camel.apache.org/using-propertyplaceholder.html#UsingPropertyPlaceholder-UsingpropertyplaceholdersforanykindofattributeintheXMLDSL
>>>
>>> Babak
>>>
>>>
>>> Scott Parkerson-4 wrote
>>> > I'm using Camel 2.10.4 with my routes defined in Blueprint. I'm trying
>>> to
>>> > use a property placeholder to configure the completionTimeout for my
>>> > aggregator, and it's complaining:
>>> >
>>> > Camel (postingResultsCamelContext) thread #6 - seda://start ERROR
>>> > [org.apache.camel.processor.DefaultErrorHandler] - Failed delivery for
>>> > (MessageId: ID-elysium-local-64760-1376927985149-0-1 on ExchangeId:
>>> > ID-elysium-local-64760-1376927985149-0-6). Exhausted after delivery
>>> > attempt: 1 caught: org.apache.camel.TypeConversionException: Error
>>> during
>>> > type conversion from type: java.lang.String to the required type:
>>> > java.lang.Long with value
>>> {{processor.posting.aggregation_timeout_millis}}
>>> > due java.lang.NumberFormatException: For input string:
>>> > "{{processor.posting.aggregation_timeout_millis}}"
>>> > org.apache.camel.TypeConversionException: Error during type conversion
>>> > from
>>> > type: java.lang.String to the required type: java.lang.Long with value
>>> > {{processor.posting.aggregation_timeout_millis}} due
>>> > java.lang.NumberFormatException: For input string:
>>> > "{{processor.posting.aggregation_timeout_millis}}"
>>> >     at
>>> >
>>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:126)
>>> >     at
>>> >
>>> org.apache.camel.core.osgi.OsgiTypeConverter.convertTo(OsgiTypeConverter.java:102)
>>> >     at
>>> >
>>> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:37)
>>> >     at
>>> > org.apache.camel.builder.SimpleBuilder.evaluate(SimpleBuilder.java:82)
>>> >     at
>>> >
>>> org.apache.camel.processor.aggregate.AggregateProcessor.isCompleted(AggregateProcessor.java:333)
>>> >     at
>>> >
>>> org.apache.camel.processor.aggregate.AggregateProcessor.doAggregation(AggregateProcessor.java:258)
>>> >     at
>>> >
>>> org.apache.camel.processor.aggregate.AggregateProcessor.process(AggregateProcessor.java:201)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
>>> >     at
>>> >
>>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
>>> >     at
>>> >
>>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
>>> >     at
>>> >
>>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
>>> >     at
>>> >
>>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
>>> >     at
>>> >
>>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:571)
>>> >     at
>>> >
>>> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:504)
>>> >     at
>>> >
>>> org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:213)
>>> >     at org.apache.camel.processor.Splitter.process(Splitter.java:98)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
>>> >     at
>>> >
>>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
>>> >     at
>>> >
>>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
>>> >     at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
>>> >     at
>>> >
>>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
>>> >     at
>>> >
>>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
>>> >     at
>>> >
>>> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>>> >     at
>>> >
>>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>>> >     at
>>> >
>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>>> >     at
>>> >
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>>> >     at
>>> >
>>> org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:275)
>>> >     at
>>> >
>>> org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:183)
>>> >     at
>>> > org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:139)
>>> >     at
>>> >
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>>> >     at
>>> >
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>>> >     at java.lang.Thread.run(Thread.java:680)
>>> > Caused by: org.apache.camel.RuntimeCamelException:
>>> > java.lang.NumberFormatException: For input string:
>>> > "{{processor.posting.aggregation_timeout_millis}}"
>>> >     at
>>> >
>>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1316)
>>> >     at
>>> > org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:962)
>>> >     at
>>> >
>>> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:47)
>>> >     at
>>> >
>>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:253)
>>> >     at
>>> >
>>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:111)
>>> >     ... 59 more
>>> > Caused by: java.lang.NumberFormatException: For input string:
>>> > "{{processor.posting.aggregation_timeout_millis}}"
>>> >     at
>>> >
>>> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>>> >     at java.lang.Long.parseLong(Long.java:410)
>>> >     at java.lang.Long.valueOf(Long.java:525)
>>> >     at
>>> >
>>> org.apache.camel.converter.ObjectConverter.toLong(ObjectConverter.java:255)
>>> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> >     at
>>> >
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> >     at
>>> >
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> >     at java.lang.reflect.Method.invoke(Method.java:597)
>>> >     at
>>> > org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:958)
>>> >     ... 62 more
>>> >
>>> > Here's my route:
>>> > <route id="PostingResults.HANDLER">
>>> >
>>> > <from
>>> > uri="activemq:{{messaging.jms.namespace}}.POSTING_RESULT_HANDLER" />
>>> >
>>> > <log
>>> > logName="com.ateb.messaging.myx.processor_posting.CamelRoutes"
>>> > loggingLevel="DEBUG" message="${in.header.CamelFileNameOnly}:
>>> > ATEB_FILETYPE->
>>> > ${in.header.ATEB_FILETYPE},
>>> > ATEB_CLIENT_ID->${in.header.ATEB_CLIENT_ID},
>>> > ATEB_FILENAME_TIMESTAMP->${in.header.ATEB_FILENAME_TIMESTAMP}"/>
>>> >
>>> > <choice>
>>> >
>>> > <when>
>>> >
>>> > <simple>
>>> > ${in.header.ATEB_FILETYPE} ==
>>> > 'POST_REQ'
>>> > </simple>
>>> >
>>> > <unmarshal ref="postingRequestBeanIO" />
>>> >
>>> > </when>
>>> >
>>> > <when>
>>> >
>>> > <simple>
>>> > ${in.header.ATEB_FILETYPE} ==
>>> > 'POST_RSLT'
>>> > </simple>
>>> >
>>> > <unmarshal ref="postingResultBeanIO" />
>>> >
>>> > </when>
>>> >
>>> > <otherwise>
>>> >
>>> > <log
>>> > logName="com.ateb.messaging.myx.posting_results.CamelRoutes"
>>> > loggingLevel="WARN" message="${in.header.CamelFileNameOnly}: Unhandled
>>> > ATEB_FILETYPE ${in.header.ATEB_FILETYPE}, dropping"/>
>>> >
>>> > <stop/>
>>> >
>>> > </otherwise>
>>> >
>>> > </choice>
>>> >
>>> > <split>
>>> >
>>> > <simple>
>>> > ${body}
>>> > </simple>
>>> >
>>> > <aggregate aggregationRepositoryRef="aggregatorRepository"
>>> >
>>> > strategyRef="postingRequestResultAggregationStrategy">
>>> >
>>> > <correlationExpression>
>>> >
>>> > <simple>
>>> >
>>> ${in.header.ATEB_CLIENT_ID}-${body.clientStoreId}-${body.rxNumber}-${in.header.ATEB_FILENAME_DATESTAMP}
>>> > </simple>
>>> >
>>> > </correlationExpression>
>>> >
>>> > <completionPredicate>
>>> >
>>> > <simple>
>>> > ${in.body.isComplete}
>>> > </simple>
>>> >
>>> > </completionPredicate>
>>> >
>>> > <completionTimeout>
>>> >
>>> > <constant>
>>> > {{processor.posting.aggregation_timeout_millis}}
>>> > </constant>
>>> >
>>> > </completionTimeout>
>>> >
>>> > <filter>
>>> >
>>> > <simple>
>>> > ${in.header.CamelAggregatedCompletedBy} ==
>>> > 'timeout'
>>> > </simple>
>>> >
>>> > <log
>>> > logName="com.ateb.messaging.myx.posting_results.CamelRoutes"
>>> > loggingLevel="WARN" message="${in.header.CamelFileNameOnly}:
>>> >
>>> ${in.header.ATEB_CLIENT_ID}-${body.clientStoreId}-${body.rxNumber}-${in.header.ATEB_FILENAME_DATESTAMP}]
>>> > Timed out waiting for aggregation"/>
>>> >
>>> > <stop />
>>> >
>>> > </filter>
>>> >
>>> > <to uri="bean:postResults" />
>>> >
>>> > </aggregate>
>>> >
>>> > </split>
>>> >
>>> > </route>
>>> > I saw in the docs that there's a custom namespace for using integer
>>> > properties in spring; do I need to do this for blueprint as well? Does
>>> it
>>> > even work for blueprint?
>>> >
>>> > --sgp
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Property-Placeholder-for-Aggregation-Completion-Timeout-Value-in-Blueprint-tp5737523p5737524.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>>
>

Reply via email to