Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8B265D1B1 for ; Wed, 19 Dec 2012 21:37:12 +0000 (UTC) Received: (qmail 55444 invoked by uid 500); 19 Dec 2012 21:37:12 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 55411 invoked by uid 500); 19 Dec 2012 21:37:12 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 55403 invoked by uid 99); 19 Dec 2012 21:37:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 21:37:12 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of christian.mueller@gmail.com designates 209.85.214.177 as permitted sender) Received: from [209.85.214.177] (HELO mail-ob0-f177.google.com) (209.85.214.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 21:37:05 +0000 Received: by mail-ob0-f177.google.com with SMTP id uo13so2522375obb.8 for ; Wed, 19 Dec 2012 13:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=jb8iwM5DEtyQlX5JxecAPgm8qiUuGupe5LfymYgHcv0=; b=W5i2vAGRlTs+05eOfCNLNiqIPNRSr8MTJ6t1vNMehRQQb77u5nSjPFeETX/vOH9Lcr Vv9YxwQ1/exEgZMcsTuGeAtpTAy5LX6ut92oBrxtbIqukNelH/S86MXJUc2KOon8/e7I r50KxTPnLAm4WlVAmhNEefD0iZTDuKEoIPk+BinHxLcDT2dp3Z6xXq/T12ARVQ4Z/Ynk LZXhd4F5C1qEQo0+8LBim598um6Y0ko1q/O9DqtITYwh/8xDkI4TaLAl4sZoVtOG469k vb/bdKFSXifKo5mdy4QoGJbLJPaL2RZxbweZ2fcg/Os7EozW88wt54CfcZm5XuTMpJkn uTFA== MIME-Version: 1.0 Received: by 10.60.7.67 with SMTP id h3mr6057675oea.31.1355953004803; Wed, 19 Dec 2012 13:36:44 -0800 (PST) Received: by 10.182.114.103 with HTTP; Wed, 19 Dec 2012 13:36:44 -0800 (PST) In-Reply-To: References: <1355100983735-5723805.post@n5.nabble.com> <1355103804220-5723808.post@n5.nabble.com> Date: Wed, 19 Dec 2012 22:36:44 +0100 Message-ID: Subject: Re: JMS persistence options have no effect From: =?ISO-8859-1?Q?Christian_M=FCller?= To: users@camel.apache.org Content-Type: multipart/alternative; boundary=e89a8f9240782ef61104d13b69ff X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f9240782ef61104d13b69ff Content-Type: text/plain; charset=ISO-8859-1 Thanks David! I updated the example and set "explicitQosEnabled" on both endpoint configurations. Now it works as expected! Thanks! @Brad: I hope this will also solve your issue. import org.apache.activemq.broker.BrokerService; import org.apache.activemq.camel.component.ActiveMQComponent; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.JndiRegistry; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.After; import org.junit.Before; import org.junit.Test; public class CamelActiveMQConsumerPersistentIssueTest extends CamelTestSupport { private BrokerService broker; @Before public void setUp() throws Exception { broker = new BrokerService(); broker.setPersistent(true); broker.setUseJmx(false); broker.addConnector("tcp://localhost:61616"); broker.start(); super.setUp(); } @After public void tearDown() throws Exception { super.tearDown(); broker.stop(); } @Test public void test() throws Exception { // 1 = NON_PERSISTENT // 2 = PERSISTENT context.addRoutes(new RouteBuilder() { public void configure() throws Exception { from("activemq:queue:test?replyToDeliveryPersistent=false&explicitQosEnabled=true") .process(new Processor() { public void process(Exchange exchange) throws Exception { assertEquals(Integer.valueOf(1), exchange.getIn().getHeader("JMSDeliveryMode", Integer.class)); exchange.getOut().setBody("Camel"); } }); } }); Exchange ex = template.request("activemq:queue:test?deliveryPersistent=false&explicitQosEnabled=true", new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setBody("What's the best integration framework?"); } }); assertEquals("Camel", ex.getOut().getBody(String.class)); assertEquals(Integer.valueOf(1), ex.getOut().getHeader("JMSDeliveryMode", Integer.class)); } @Override protected JndiRegistry createRegistry() throws Exception { JndiRegistry registry = super.createRegistry(); registry.bind("activemq", ActiveMQComponent.activeMQComponent("failover:(tcp://localhost:61616)")); return registry; } } Best, Christian On Mon, Dec 17, 2012 at 6:55 PM, David Karlsen wrote: > explicitQos -- --e89a8f9240782ef61104d13b69ff--