You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Alessio Giannetti (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/03/05 12:01:57 UTC

[jira] [Issue Comment Edited] (CAMEL-5007) PropertiesComponent on errorHandler properties

    [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222267#comment-13222267 ] 

Alessio Giannetti edited comment on CAMEL-5007 at 3/5/12 11:01 AM:
-------------------------------------------------------------------

Like said here http://camel.apache.org/properties.html 
"Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs." 
So it works just with endpoint definition.
I would have used something like:

<propertyPlaceholder id="properties" location="classpath:bonus-tracker-context.properties" prefixToken="#[" suffixToken="]"/>

<endpoint id="getBulkBonusMessagesTimer"
    uri="timer://getBulkBonusMessagesTimer?fixedRate=true&amp;period=#[bulkBonusMessagesTimerPeriod]"/>

<errorHandler id="myErrorHandler" type="DefaultErrorHandler">
<redeliveryPolicy maximumRedeliveries="#[mrp]"
    retryAttemptedLogLevel="#[rall]"
    redeliverDelay="#[rd]"/>
</errorHandler>

But the propertiesComponent works only with the uri definition.

So i just defined 

<bean id="errorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
         <property name="deadLetterUri" value="seda:deadLetterManager"/>
         <property name="useOriginalMessage" value="true"/>
         <property name="redeliveryPolicy" ref="redeliveryPolicy"/>
    </bean>

    <bean id="redeliveryPolicy" class="org.apache.camel.processor.RedeliveryPolicy">
        <property name="maximumRedeliveries" value="${errorHandler.maximumRedeliveries}"/>
        <property name="redeliverDelay" value="${errorHandler.redeliveryDelay}"/>
        <property name="retryAttemptedLogLevel" value="${errorHandler.retryAttemptedLogLevel}"/>
    </bean>

in spring and used it in the camel context.

                
      was (Author: agiannetti):
    Like said here http://camel.apache.org/properties.html 
"Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs." 
So it works just with endpoint definition.
I would have used something like:

<propertyPlaceholder id="properties" location="classpath:bonus-tracker-context.properties"/>

<endpoint id="getBulkBonusMessagesTimer"
    uri="timer://getBulkBonusMessagesTimer?fixedRate=true&amp;period={{bulkBonusMessagesTimerPeriod}}"/>

<errorHandler id="myErrorHandler" type="DefaultErrorHandler">
<redeliveryPolicy maximumRedeliveries="{{mrp}}"
    retryAttemptedLogLevel="{{rall}}"
    redeliverDelay="{{rd}}"/>
</errorHandler>

But the propertiesComponent works only with the uri definition.

So i just defined 

<bean id="errorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
         <property name="deadLetterUri" value="seda:deadLetterManager"/>
         <property name="useOriginalMessage" value="true"/>
         <property name="redeliveryPolicy" ref="redeliveryPolicy"/>
    </bean>

    <bean id="redeliveryPolicy" class="org.apache.camel.processor.RedeliveryPolicy">
        <property name="maximumRedeliveries" value="${errorHandler.maximumRedeliveries}"/>
        <property name="redeliverDelay" value="${errorHandler.redeliveryDelay}"/>
        <property name="retryAttemptedLogLevel" value="${errorHandler.retryAttemptedLogLevel}"/>
    </bean>

in spring and used it in the camel context.


                  
> PropertiesComponent on errorHandler properties
> ----------------------------------------------
>
>                 Key: CAMEL-5007
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5007
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Alessio Giannetti
>            Assignee: Claus Ibsen
>            Priority: Minor
>
> PropertiesComponent should apply on errorHandler and redeliveryPolicy properties definition in the camel context.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira