Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Apache Camel - Messages are not being processed successfully if the route is activated using JMX console

$
0
0
I am using Camel "CronScheduledRoutePolicy" to keep my route active between
certain hours.
CronScheduledRoutePolicy policy = new CronScheduledRoutePolicy();
policy.setRouteStartTime("0 0 9 * * ?");
policy.setRouteStopTime("0 0 18 * * ?");

from("jms:inboundqueue").routePolicy(policy).noAutoStartup()

Since 'noAutoStartup' is set, it doesn't start the route when the server is
restarted between 9 and 18 hrs.
So, in this case I am using JMX console to start the route, but the
messages are failing with "org.apache.camel.CamelExecutionException:
Exception occurred during execution on the exchange".
when I debugged camel code, I have seen the following -
"/org.apache.camel.InvalidPayloadException, No body available of type:
com......Caused by: [org.apache.camel.TypeConversionException - Error during
type conversion from type: byte[] to the required type:
com.api.jms.generated.PurgeJms with value [B [ at ] 7376f132 due
com.api.jms.generated.PurgeJms$JaxbAccessorF_purgeTargetIds cannot be cast
to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor]"/

But the same messages are processed successfully if the route is not
activated using JMX but let it start automatically at the mentioned time.

Is there anything that I need to do when I start the route manually with JMX
console ?

Viewing all articles
Browse latest Browse all 5648

Trending Articles