You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by KGarner <ke...@fmr.com> on 2017/06/08 13:26:22 UTC
Rest producer using http4 with https endpoint
Using a rest producer backed by http4 component, providing an https endpoint
as host fails.
Error: No component found with scheme: http4s
Looks like line 392 in HttpComponent.java
host = host.replace("http", "http4");
Should instead replace http->http4 and https->https4, right?
Thanks for any assistance.
Sample test...
------
package test;
import org.apache.camel.CamelContext;
import org.apache.camel.LoggingLevel;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.javaconfig.CamelConfiguration;
import org.apache.camel.test.spring.CamelSpringDelegatingTestContextLoader;
import org.apache.camel.test.spring.CamelSpringRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import test.SimpleTest.TestConfig;
@RunWith(CamelSpringRunner.class)
@ContextConfiguration(classes = { CamelConfiguration.class, TestConfig.class
}, loader = CamelSpringDelegatingTestContextLoader.class)
public class SimpleTest {
@Autowired
private CamelContext camelContext;
@Test
public void test() {
ProducerTemplate template = camelContext.createProducerTemplate();
String body = template.requestBody("direct:test", null, String.class);
System.err.println(body);
}
@Configuration
public static class TestConfig {
@Bean
public RouteBuilder buildRoute() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:test")
.to("rest:get:/?componentName=http4&host=https://example.com");
}
};
}
}
}
--
View this message in context: http://camel.465427.n5.nabble.com/Rest-producer-using-http4-with-https-endpoint-tp5802582.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Rest producer using http4 with https endpoint
Posted by KGarner <ke...@fmr.com>.
Has anyone else noticed this gap with secure endpoints in the rest producer
backed by http4? If I'm not off base too much, it seems like a
straightforward fix to adjust the replace line in the code, right?
--
View this message in context: http://camel.465427.n5.nabble.com/Rest-producer-using-http4-with-https-endpoint-tp5802582p5803665.html
Sent from the Camel - Users mailing list archive at Nabble.com.