Hi I suspect its because you use Spring's Caching ConnectionFactory as connection pool. So even if camel-jms has CACHE_NONE, then because the consumer is not cached on the reply listener (because you configured it to cache none), it would have to get a new consumer from the connection factory, which is using the Spring Caching ConnectionFactory, that would not create a new consumer, but return a previous used consumer from its caching pool, because you configured it with cacheConsumers=true.
But I haven't had time to look into this. Just a thought. On Mon, Nov 12, 2012 at 2:52 PM, anaCortes <anquiroe...@hotmail.com> wrote: > I´ve changed the unit test. Now i´m using the CamelJmsTestHelper for the > JmsComponent (now there´s no external broker) and i´ve added setAssertPeriod > to the mock. > > /** > * @author anacortes > */ > public class JmsReplyToCacheLevelNameTest extends CamelTestSupport { > > protected CamelContext createCamelContext() throws Exception { > CamelContext camelContext = super.createCamelContext(); > > ConnectionFactory connectionFactory = > CamelJmsTestHelper.createPersistentConnectionFactory(); > ActiveMQComponent activemqComponent = new ActiveMQComponent(); > activemqComponent.setReplyToCacheLevelName("CACHE_NONE"); > activemqComponent.setConnectionFactory(connectionFactory); > camelContext.addComponent("activemq", activemqComponent); > > return camelContext; > } > > @Test > public void testStuckMessagesWithFixedReplyQueue() throws Exception { > getMockEndpoint("mock:result").expectedMessageCount(1); > getMockEndpoint("mock:result").setAssertPeriod(200); > > new MyThread().start(); > new MyThread().start(); > new MyThread().start(); > > assertMockEndpointsSatisfied(); > } > > @Override > protected RouteBuilder createRouteBuilder() throws Exception { > return new RouteBuilder() { > public void configure() throws Exception { > from("direct:start") > .inOut("activemq:queue:foo?replyTo=queue:bar") > .to("mock:result"); > > from("activemq:queue:foo").transform(body().prepend("Bye > ")); > } > }; > } > > class MyThread extends Thread { > public void run() { > template.requestBody("direct:start", "Camel"+getName(), > String.class); > } > } > > } > > Here we can see that the mock only receives one message (and not the three > messages). > > If we add to the CachingConnectionFactory, cacheConsumer to false, then the > mock will receive the three messages (the stuck messages are gone). > > cached.setCacheConsumers(false); > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722598.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen