You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Frank Schwarz (JIRA)" <ji...@apache.org> on 2009/04/20 08:32:36 UTC

[jira] Created: (CAMEL-1546) Exception handler is not applied for aggregate component

Exception handler is not applied for aggregate component
--------------------------------------------------------

                 Key: CAMEL-1546
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.0-M1
            Reporter: Frank Schwarz


<camelContext xmlns="http://camel.apache.org/schema/spring">
	<onException>
		<exception>java.lang.Exception</exception>
		<!-- no retry, just dump the error -->
		<handled><constant>true</constant></handled>
		<convertBodyTo type="java.lang.String" />
		<to uri="bean:ErrorMessageTransformProcessor" />
		<to uri="freemarker:error.ftl" />
		<to uri="file:///C:/temp/camel/err" />
	</onException>
...
	<route>
		<from uri="jms:queue:InQueue"/>
		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
			<correlationExpression>      
				<header>MyCorrelationId</header>
			</correlationExpression>
			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
			<to uri="jms:queue:OutQueue" />
		</aggregate>
	</route>
</camel>

If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Willem Jiang commented on CAMEL-1546:
-------------------------------------

You need to do something for aggregating the exception in your MyAggregationStrategy, as we do in UseLatestAggrationStrategy[1].
[1] https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/UseLatestAggregationStrategy.java

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Claus Ibsen commented on CAMEL-1546:
------------------------------------

Franks you should move the </aggregate> further up to not include the bean you want to be triggered outside the aggregator.

So what you want to do is like this
{code:xml}
<route>
<from uri="jms:queue:InQueue"/>
<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
<correlationExpression> 
<header>MyCorrelationId</header>
</correlationExpression>
</aggregate>
<!-- end the aggregator, so the route below happens after we have aggregated -->
<to uri="bean:AggregatedItemsTransformProcessor" />
<to uri="jms:queue:OutQueue" />
</route>
{code}

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Frank Schwarz closed CAMEL-1546.
--------------------------------

    Resolution: Working as Designed

Thank you for your advice. This was also my workaround in the first place.

I am closing this issue because of the fact that it is still unclear, whether the reported behavior is by design or is a bug.
It seems to me that the observed behavior is a mixture of me misusing the DSL and the aggregator component being unable to process exceptions, thrown by one of its destination.

So, someone who considers this behavior has to be fixed, please reopen the case.

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Claus Ibsen commented on CAMEL-1546:
------------------------------------

Frank can you try adding an empty/noop processor?
Could be an issue how the aggregator model is build and how you define where it *ends*.
And I suspect it.

*Anyway splitting into a sub route should work, also to indicate that your route is two fold*
You can split you route into a sub route using seda to force async, that should work.

<route>
<from uri="jms:queue:InQueue"/>
  <aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
    <correlationExpression> 
      <header>MyCorrelationId</header>
    </correlationExpression>
    <to uri="seda:processAggregated"/>
</aggregate>
</route>

<route>
  <from uri="seda:processAggregated"/>
  <to uri="bean:AggregatedItemsTransformProcessor" />
  <to uri="jms:queue:OutQueue" />
</route>


> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

Posted by "Frank Schwarz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51289#action_51289 ] 

Frank Schwarz commented on CAMEL-1546:
--------------------------------------

"Nothing happens" means, even the message is dropped (to nowhere)

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Claus Ibsen commented on CAMEL-1546:
------------------------------------

The Aggregator is based on the BatchProcessor that has this _feature_ or flaw :)

There should be a ticket related related to this and how exceptions should be handled with the BatchProcessor.

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Claus Ibsen commented on CAMEL-1546:
------------------------------------

Frank

I had a "sleep" on this (actually a walk with the dog) and my suspicion is that the error handler is not wrapped around each child output in the aggregator.
So whenever an exception occurs its propagated back to the aggregator (based on batch processor) that has this (flaw/feature) that it swallows exceptions.

So when you split the route into a sub route outside the aggreagator then the error handler is intercepted as expected.

The remedy is pobably to ensure the logic that applies the error handler also can handle the aggregator and its children as well.





> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

Posted by "Frank Schwarz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51288#action_51288 ] 

Frank Schwarz commented on CAMEL-1546:
--------------------------------------

The exception occurs after the aggregation being complete, so the aggregation strategy is not invoked any more. 
Lets put it differently: The bean "AggregatedItemsTransformProcessor" already has the aggregation-outcome as its input and is now throwing an exception.

Am I misusing the DSL?

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Claus Ibsen commented on CAMEL-1546:
------------------------------------

Franks

Good news. I am working on this and have some prototype code working. But it will basically support your route out of the box.

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1546) Exception handler is not applied for aggregate component

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

Claus Ibsen edited comment on CAMEL-1546 at 4/20/09 2:31 AM:
-------------------------------------------------------------

Frank can you try adding an empty/noop processor?
Could be an issue how the aggregator model is build and how you define where it *ends*.
And I suspect it.

*Anyway splitting into a sub route should work, also to indicate that your route is two fold*
You can split you route into a sub route using seda to force async, that should work.

{code}
<route>
<from uri="jms:queue:InQueue"/>
  <aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
    <correlationExpression> 
      <header>MyCorrelationId</header>
    </correlationExpression>
    <to uri="seda:processAggregated"/>
</aggregate>
</route>

<route>
  <from uri="seda:processAggregated"/>
  <to uri="bean:AggregatedItemsTransformProcessor" />
  <to uri="jms:queue:OutQueue" />
</route>
{code}

      was (Author: davsclaus):
    Frank can you try adding an empty/noop processor?
Could be an issue how the aggregator model is build and how you define where it *ends*.
And I suspect it.

*Anyway splitting into a sub route should work, also to indicate that your route is two fold*
You can split you route into a sub route using seda to force async, that should work.

<route>
<from uri="jms:queue:InQueue"/>
  <aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
    <correlationExpression> 
      <header>MyCorrelationId</header>
    </correlationExpression>
    <to uri="seda:processAggregated"/>
</aggregate>
</route>

<route>
  <from uri="seda:processAggregated"/>
  <to uri="bean:AggregatedItemsTransformProcessor" />
  <to uri="jms:queue:OutQueue" />
</route>

  
> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1546) Exception handler is not applied for aggregate component

Posted by "Frank Schwarz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51292#action_51292 ] 

Frank Schwarz commented on CAMEL-1546:
--------------------------------------

This configuration is not possible, as there has to be a processor within <aggregate>

Caused by: java.lang.IllegalArgumentException: processor must be specified
        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:170)
        at org.apache.camel.processor.BatchProcessor.<init>(BatchProcessor.java:55)
        at org.apache.camel.processor.Aggregator.<init>(Aggregator.java:59)
        at org.apache.camel.processor.Aggregator.<init>(Aggregator.java:49)
        at org.apache.camel.model.AggregateDefinition.createAggregator(AggregateDefinition.java:158)
        at org.apache.camel.model.AggregateDefinition.createProcessor(AggregateDefinition.java:111)
        at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:2044)
        at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:95)
        at org.apache.camel.model.InterceptorDefinition.createProcessor(InterceptorDefinition.java:67)
        at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:1939)
        at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:99)
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:309)
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:121)
        at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:481)
        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:777)
        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:759)
        at org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:165)
        at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:160)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:50)
        at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:95)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:114)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
        at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:58)
        at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:47)
        at org.jboss.spring.deployers.ApplicationContextDeployer$1.doCreate(ApplicationContextDeployer.java:41)
        at org.jboss.spring.deployers.ApplicationContextDeployer$1.doCreate(ApplicationContextDeployer.java:44)
        at org.jboss.spring.deployers.AbstractSpringMetaDataDeployer$SpringDeploymentVisitor.deploy(AbstractSpringMetaDataDeployer.java:72)
        at org.jboss.spring.deployers.AbstractSpringMetaDataDeployer$SpringDeploymentVisitor.deploy(AbstractSpringMetaDataDeployer.java:58)
        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.deploy(AbstractRealDeployerWithInput.java:125)
        ... 27 more

> Exception handler is not applied for aggregate component
> --------------------------------------------------------
>
>                 Key: CAMEL-1546
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1546
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Frank Schwarz
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<onException>
> 		<exception>java.lang.Exception</exception>
> 		<!-- no retry, just dump the error -->
> 		<handled><constant>true</constant></handled>
> 		<convertBodyTo type="java.lang.String" />
> 		<to uri="bean:ErrorMessageTransformProcessor" />
> 		<to uri="freemarker:error.ftl" />
> 		<to uri="file:///C:/temp/camel/err" />
> 	</onException>
> ...
> 	<route>
> 		<from uri="jms:queue:InQueue"/>
> 		<aggregate batchTimeout="5000" strategyRef="MyAggregationStrategy">
> 			<correlationExpression>      
> 				<header>MyCorrelationId</header>
> 			</correlationExpression>
> 			<to uri="bean:AggregatedItemsTransformProcessor" /> ***
> 			<to uri="jms:queue:OutQueue" />
> 		</aggregate>
> 	</route>
> </camel>
> If in the bean *** occurs an exception, nothing happens. Debugging shows that the exception handler is not triggered. Nothing is logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.