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 (Created) (JIRA)" <ji...@apache.org> on 2012/02/15 01:03:59 UTC

[jira] [Created] (CAMEL-5007) PropertiesComponent on errorHandler properties

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
            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

        

[jira] [Commented] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Alessio Giannetti (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222267#comment-13222267 ] 

Alessio Giannetti commented on CAMEL-5007:
------------------------------------------

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

        

[jira] [Resolved] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Claus Ibsen (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-5007.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9.2
                   2.10.0

Now works for both Spring and Blueprint XML DSLs
                
> 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
>             Fix For: 2.10.0, 2.9.2
>
>
> 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

        

[jira] [Commented] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Willem Jiang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208263#comment-13208263 ] 

Willem Jiang commented on CAMEL-5007:
-------------------------------------

Hi Alessio,

I just take a quick look at the code (ErrorHandlerDefinitionParser). It is hard to add the support of resolving the value of PropertiesComponent, as the ErrorHandlder is not bund to the camel context which provides a way to resolve the value of properties.

To address that, we may need to do refactor on the camel-core to delay the creation of the ErrorHandler or find a more generic way resolve the value of PropertiesComponent.  

For now, we could workaround it by using the property resolve of spring. 

Willem


                
> 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
>            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

        

[jira] [Commented] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226864#comment-13226864 ] 

Claus Ibsen commented on CAMEL-5007:
------------------------------------

Thanks I have reproduced the issue. Its when you embed a <redeliveryPolicy> inside the <errorHandler>. This requires a bit more than Spring can handle, so we need to adjust the error handler parser a bit in camel-spring, to fix this.
                
> 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

        

[jira] [Assigned] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Claus Ibsen (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-5007:
----------------------------------

    Assignee: Claus Ibsen
    
> 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

        

[jira] [Commented] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226869#comment-13226869 ] 

Claus Ibsen commented on CAMEL-5007:
------------------------------------

We should also check the Blueprint XML DSL as well to see if there is a problem as well.
                
> 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

        

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

Posted by "Alessio Giannetti (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Commented] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227026#comment-13227026 ] 

Claus Ibsen commented on CAMEL-5007:
------------------------------------

I got a pending fix for camel-spring. Will have to do a similar fix for camel-blueprint.
                
> 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

        

[jira] [Commented] (CAMEL-5007) PropertiesComponent on errorHandler properties

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221849#comment-13221849 ] 

Claus Ibsen commented on CAMEL-5007:
------------------------------------

This should already be supported. Can you provide a use-case that does not?
                
> 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
>            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