Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 64372 invoked from network); 11 Nov 2010 16:19:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Nov 2010 16:19:16 -0000 Received: (qmail 69337 invoked by uid 500); 11 Nov 2010 16:19:48 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 69184 invoked by uid 500); 11 Nov 2010 16:19:47 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 69176 invoked by uid 500); 11 Nov 2010 16:19:47 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 69173 invoked by uid 99); 11 Nov 2010 16:19:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 16:19:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 16:19:45 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oABGJN4P020262 for ; Thu, 11 Nov 2010 16:19:23 GMT Message-ID: <3263929.2251289492363272.JavaMail.jira@thor> Date: Thu, 11 Nov 2010 11:19:23 -0500 (EST) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-3328) NPE on Request-Reply InOut (Test attached) In-Reply-To: <23804641.1981289485641891.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63265#action_63265 ] Claus Ibsen commented on CAMEL-3328: ------------------------------------ Lars, you need to start your producer before you can use it {code} producer = endpoint.createProducer(); producer.start(); {code} Likewise you should stop it when you are done using it, eg when you test is done > NPE on Request-Reply InOut (Test attached) > ------------------------------------------ > > Key: CAMEL-3328 > URL: https://issues.apache.org/activemq/browse/CAMEL-3328 > Project: Apache Camel > Issue Type: Bug > Components: camel-jms > Affects Versions: 2.5.0 > Environment: Linux rudi-duo 2.6.32-24-generic-pae #43-Ubuntu SMP Thu Sep 16 15:30:27 UTC 2010 i686 GNU/Linux > java 1.6.0.22 > Reporter: Lars Gohlke > Assignee: Claus Ibsen > > simply request reply with ActiveMQ 5.4.1 using a queue is failing in v2.5 instead is running in v.2.4 > {code:java} > import static org.junit.Assert.assertTrue; > import org.apache.activemq.ActiveMQConnectionFactory; > import org.apache.camel.Endpoint; > import org.apache.camel.Exchange; > import org.apache.camel.ExchangePattern; > import org.apache.camel.Processor; > import org.apache.camel.Producer; > import org.apache.camel.builder.RouteBuilder; > import org.apache.camel.component.jms.JmsComponent; > import org.apache.camel.impl.DefaultCamelContext; > import org.junit.After; > import org.junit.Before; > import org.junit.Test; > public class RequestReplyFailureTest > { > private Endpoint endpoint; > private Producer producer; > private DefaultCamelContext camel; > @Before > public void before() throws Exception > { > String brokerUrl = "tcp://localhost:61616"; > camel = new DefaultCamelContext(); > camel.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(new ActiveMQConnectionFactory(brokerUrl))); > final String url = "jms:queue:test"; > endpoint = camel.getEndpoint(url); > camel.addRoutes(new RouteBuilder() > { > @Override > public void configure() throws Exception > { > from(url).process(new Processor() > { > @Override > public void process(Exchange exchange) throws Exception > { > // simply set 'pong' as response > exchange.getOut().setBody("pong"); > } > }); > } > }); > System.out.println(camel.getVersion()); > camel.start(); > producer = endpoint.createProducer(); > } > @After > public void after() throws Exception > { > camel.stop(); > } > /** > * @throws Exception > */ > @Test > public void testInOut() throws Exception > { > Exchange exchange = endpoint.createExchange(ExchangePattern.InOut); > exchange.getIn().setBody("ping"); > producer.process(exchange); > assertTrue("pong".equals(exchange.getOut().getBody())); > } > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.