You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/11/11 18:15:22 UTC
[jira] Resolved: (CAMEL-3328) NPE on Request-Reply InOut (Test
attached)
[ https://issues.apache.org/activemq/browse/CAMEL-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-3328.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.6.0
trunk: 1034004.
camel-jms now throws an exception if it hasnt been started tell the end user that it must be started before it can be used
> 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
> Fix For: 2.6.0
>
>
> 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.