camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-3328) NPE on Request-Reply InOut (Test attached)
Date Thu, 11 Nov 2010 15:15:22 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63262#action_63262
] 

Claus Ibsen commented on CAMEL-3328:
------------------------------------

See this unit test which works
http://svn.apache.org/viewvc?rev=1033961&view=rev

> 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.


Mime
View raw message