Hi
A quick test shows:
JMX disabled:
EventDrivenConsumerRoute[Endpoint[direct:start] ->
UnitOfWork(StreamCachingInterceptor(choice{when body contains Hello:
Pipeline[DeadLetterChannel[sendTo(Endpoint[mock:hello]),
log:org.apache.camel.DeadLetterChannel?level=error],
DeadLetterChannel[StreamCachingInterceptor(choice{when body contains
Bye: DeadLetterChannel[StreamCachingInterceptor(sendTo(Endpoint[mock:bye])),
log:org.apache.camel.DeadLetterChannel?level=error]}),
log:org.apache.camel.DeadLetterChannel?level=error]]}))]
JMX enabled:
EventDrivenConsumerRoute[Endpoint[direct:start] ->
UnitOfWork(Instrumentation(Instrumentation(choice{when body contains
Hello: Pipeline[sendTo(Endpoint[mock:hello]), choice{when body
contains Bye: sendTo(Endpoint[mock:bye])}]})))]
So yeah there is a bug in Camel that is affected by the JMX.
I will log a JIRA for this.
https://issues.apache.org/activemq/browse/CAMEL-1463
On Tue, Mar 17, 2009 at 9:15 AM, Claus Ibsen <[email protected]> wrote:
> On Fri, Mar 6, 2009 at 1:46 PM, _Jens <[email protected]> wrote:
>>
>> Hi,
>>
>> first of all, thanks to both of you, Gert and Willem, for the quick replies.
>> I saw that the jira was already fixed, great job.
>>
>> Does this mean that the methods for disabling stream caching will be removed
>> in the future?
>>
>> I have tried to use "noErrorHandler" but there was a special case that used
>> the default error handler at some point and I wasn't able to change this. A
>> drilled down version of my scenario is shown in the test case below.
>>
>> It has to do with the choice and when elements in the route. They seem to
>> introduce the standard error handler, as they don't inherit the configured
>> one. The standard error handling then configures the route to use stream
>> caching again. For some reason this only seems to happen if the JMX agent is
>> disabled in the CamelContext, which I simulate by setting the system
>> property. Of course, in our real scenario we simply disable it in the
>> application context.
> So you are saying that with/without JMX it has an influence on your route?
> That is kinda odd, but there could be a gremlin.
>
> Need to check into this.
>
>
>>
>> �...@test
>> public void testUploadFailsForBigFileWithNoErrorHandler() throws
>> Exception {
>> System.setProperty(JmxSystemPropertyKeys.DISABLED, "true");
>> DefaultCamelContext context = new DefaultCamelContext();
>>
>> context.addRoutes(new RouteBuilder() {
>> �...@override
>> public void configure() throws Exception {
>> errorHandler(noErrorHandler());
>>
>> from("jetty:http://localhost:8989/bigfile")
>>
>> .choice().when(header("foo").isEqualTo("bar")).to("direct:end")
>> .otherwise().end();
>>
>> from("direct:end")
>> .process(new Processor() {
>> public void process(Exchange exchange) throws
>> Exception {
>> InputStream inputStream =
>> exchange.getIn().getBody(InputStream.class);
>> while (inputStream.read() != -1) {}
>> }
>> });
>> }
>> });
>>
>> context.start();
>>
>> HttpClient client = new HttpClient();
>> PostMethod method = new PostMethod("http://localhost:8989/bigfile");
>> File file = new File("c:\\temp\\test.bin.ok2");
>> method.setRequestEntity(new FileRequestEntity(file,
>> "unknown/unknown"));
>> assertEquals(200, client.executeMethod(method));
>> }
>>
>> --
>> View this message in context:
>> http://www.nabble.com/StreamCaching-in-Camel-1.6-tp22305654p22371815.html
>> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>
--
Claus Ibsen
Apache Camel Committer
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/