apache-camel

Apache Camel 2.15.2 not able to create jetty instance

风流意气都作罢 提交于 2019-12-24 14:18:08
问题 When I was using 2.14 version of camel, I was able to get jetty instance created... however 2.15.2 is giving below error while tomcat loads the app org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jetty' defined in ServletContext resource [/WEB-INF/classes/camel-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jetty.JettyHttpComponent]:

How to use camel-avro-consumer & producer?

十年热恋 提交于 2019-12-24 14:14:01
问题 I dont see an example of how to use camel-avro component to produce and consume kafka avro messages? Currently my camel route is this. what should it be changed in order to work with schema-registry and other props like this using camel-kafka-avro consumer & producer. props.put(AbstractKafkaAvroSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, "http://localhost:8081"); props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS

Streaming to a file from an HTTP POST request in CAMEL

て烟熏妆下的殇ゞ 提交于 2019-12-24 14:13:11
问题 As a follow-up to Using Camel to stream output from a POST to a URL I need to stream to a file from an HTTP POST request using CAMEL without waiting for the entire download to occur. I tried the uri:stream uri:file and uri:bean components and all failed to stream to the file byte-by-byte but instead waited for the entire payload to finish. I believe I must be doing something wrong configuration wise because while the file is downloaded eventually, it isn't done (as judging from the output of

Custom HTTPBinding for HTTP Component

孤街醉人 提交于 2019-12-24 13:45:17
问题 I'm trying to throw an exception if HTTP response code is anything other than 200 or 201. I tried to override http4.DefaultHttpBinding, but the class is never getting called. What am I doing wrong here? public class CustomHttpBinding extends org.apache.camel.component.http4.DefaultHttpBinding { Logger log = Logger.getLogger(CustomHttpBinding.class); private static final Integer HTTP_OK = 200; private static final Integer HTTP_CREATED = 201; @Override public void doWriteResponse(Message

Apache Camel - Receiving SOAP response with empty body

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 13:33:55
问题 Created SOAP service using Apache camel 2.15.3 and everything works fine, even the response SOAP body is valid. Camel 2.15.3 is dependent on cxf 3.0.6 But when i updated cxf-core to 3.1.3, everything works fine, except the SOAP response body is EMPTY. There is no error logs, and the server starts up normally. am i missing some dependencies ? POM.xml <properties> <log4j.version>1.2.17</log4j.version> <camel.version>2.15.3</camel.version> <spring.version>4.1.6.RELEASE</spring.version> <cxf

Convert CSV file to JSON file with Apache Camel via List of Maps

五迷三道 提交于 2019-12-24 12:25:24
问题 The goal is to learn how to read CSV to List of Maps, then how to marshal it to JSON. Once I understand how to do it, I will get how to define more useful routes. I use XML to define routes, another restriction is not to create any transformation beans, but use only the existing components. My understanding is obvoiusly lacks some concept. I understand that you have to provide a bean as a consumer, then you may pass it on; but what's wrong with the List of Maps that the doc says the csv

How to change Processor properties during runtime using Camel?

隐身守侯 提交于 2019-12-24 12:16:06
问题 I have a Camel Route Definition written in Java DSL like this: from(myEndpoint) .throttle(200) .to(myOtherEndpoint); This connects my two endpoints using a Throttler which limits the message flow to 200 messages per second. I'm looking for a way to change the maximumRequestCount / second during runtime. So I need to somehow get to the Throttler instance which is called and change the property. How can I access the Throttler? 回答1: Ok, I figured it out by myself ... You need to define your

Spring-Camel (camel logs by default goes console appender)

浪子不回头ぞ 提交于 2019-12-24 11:48:07
问题 I am facing one strange problem , I am working on one batch application using below tech STACK Spring (IOC container) , spring batch , Hibernate , camel and Log4J for logging I have configured log4J for file appender only and my all application logs goes to my log file , but strange thing is that all Camel logs goes to console appender (I have no console apender configured on my log4J properties file) Spring – Camel Integration is XMl element : <camelContext xmlns="http://camel.apache.org

Camel .beanRef deprecated - how now to access container-managed beans in Java DSL route?

眉间皱痕 提交于 2019-12-24 10:13:12
问题 As of Apache Camel 2.16.3 in 2015, all of the .beanRef Java DSL routebuilder methods have been deprecated. Unfortunately, even in 2017 the official Camel documentation still says to use the deprecated .beanRef methods. While the API says to use the .bean(...) methods instead, all of these methods instantiate a new version of the bean or expect an existing one passed in. My question is, how do I use these methods with the Spring framework to pass in a Spring-managed bean in a Java DSL route

Apache camel SSL connection to restful service

為{幸葍}努か 提交于 2019-12-24 10:05:16
问题 I am busy with a project where I have to do a GET on an exposed rest service using specific certificates. I am using the apache camel framework with the https4 component. I created a keystore and tested it using soapUI and it connected successfully, but I am however unable to connect through my project. I used the following page as reference: http://camel.apache.org/http4.html I set up the SSL for the HTTP Client through the following configuration: <spring:sslContextParameters id=