camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huntc <hu...@mac.com>
Subject Avoiding type conversions with the direct component
Date Tue, 16 Jun 2009 12:26:12 GMT

Hi there,

Quick (probably dumb) question. I'm looking to avoid a type conversion while
using the direct: component.

I've been of the opinion that using the direct: component is a nice way to
break up my routes into nicely separated chunks. However I now find that
sending a body with one of my (large) POJOs takes several seconds.

Having profiled things I see that there is a
"NoTypeConversionAvailableException" and then the stack trace shows that the
object is being converted to a string, which then goes on to call a lot of
JSON code I have. Here's a sample of the stack trace:


...
com.classactionpl.gml.Feature.toString()
java.lang.String.valueOf(Object)
java.lang.StringBuilder.append(Object)
org.apache.camel.NoTypeConversionAvailableException.(Object, Class)
org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(Class,
Exchange, Object)
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(Class,
Exchange, Object)
org.apache.camel.impl.MessageSupport.getBody(Class, Object)
org.apache.camel.impl.MessageSupport.getBody(Class)
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(Exchange,
AsyncCallback)
org.apache.camel.processor.DeadLetterChannel.process(Exchange,
AsyncCallback, DeadLetterChannel$RedeliveryData)
org.apache.camel.processor.DeadLetterChannel.process(Exchange,
AsyncCallback)
org.apache.camel.processor.Pipeline.process(Exchange, Exchange,
AsyncCallback, Iterator, AsyncProcessor)
org.apache.camel.processor.Pipeline.process(Exchange, AsyncCallback)
org.apache.camel.management.InstrumentationProcessor.process(Exchange,
AsyncCallback)
org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(Exchange,
AsyncCallback)
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(Exchange,
AsyncCallback)
org.apache.camel.processor.UnitOfWorkProcessor.process(Exchange,
AsyncCallback)
org.apache.camel.component.direct.DirectProducer.process(Exchange,
AsyncCallback)
org.apache.camel.processor.SendProcessor.process(Exchange, AsyncCallback)
org.apache.camel.management.InstrumentationProcessor.process(Exchange,
AsyncCallback)
org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(Exchange,
AsyncCallback)
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(Exchange,
AsyncCallback)
org.apache.camel.processor.DeadLetterChannel.process(Exchange,
AsyncCallback, DeadLetterChannel$RedeliveryData)
org.apache.camel.processor.DeadLetterChannel.process(Exchange,
AsyncCallback)
org.apache.camel.processor.Pipeline.process(Exchange, Exchange,
AsyncCallback, Iterator, AsyncProcessor)
org.apache.camel.processor.Pipeline.process(Exchange, AsyncCallback)
org.apache.camel.management.InstrumentationProcessor.process(Exchange,
AsyncCallback)
org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(Exchange,
AsyncCallback)
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(Exchange,
AsyncCallback)
org.apache.camel.processor.UnitOfWorkProcessor.process(Exchange,
AsyncCallback)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessor, Exchange)
org.apache.camel.processor.DelegateAsyncProcessor.process(Exchange)
org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(Exchange)
org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(JobExecutionContext)
org.apache.camel.component.quartz.CamelJob.execute(JobExecutionContext)
org.quartz.core.JobRunShell.run()
org.quartz.simpl.SimpleThreadPool$WorkerThread.run()


Any recommendations on how I should avoid this conversion?

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Avoiding-type-conversions-with-the-direct-component-tp24053271p24053271.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message