apache-camel

Redis serialization prefixed with extra string

血红的双手。 提交于 2019-12-05 17:57:28
Camel-Redis's serializer is prefixing extra characters to message key. When I checked the DB, the message key shows something like.. "\xac\xed\x00\x05t\x00\x11test150827171118" As you can see, the string "\xac\xed\x00\x05t\x00\x11" is prefixed for key "test150827171118" . I tried two patterns, Firstly, I set the serializer in the registry directly. Registry.put("serializer", new StringRedisSerializer()); Second pattern is by setting in the RedisTemplate first. Then putting the redis template in the registry. RedisTemplate<?, ?> template = new RedisTemplate<>(); template.setKeySerializer(new

Apache Camel POJO Bean Processor Singleton or Prototype?

狂风中的少年 提交于 2019-12-05 17:44:35
I'm using Camel's spring DSL to build routes and I'm using my POJO bean as a processor. Initially, I as doing: <bean ref="myPojoBeanProcessor"/> where, 'myPojoBeanProcessor' was defined as a bean in my spring context. Then, I switched to: <bean beanType="com.mycompany.transformation.MyPojoBeanProcessor"/> The Java DSL equivalent would be, I think: from("xxx").bean(MyPojoBeanProcessor.class).xxx I'm wondering if with the later approach, a bean object would be instantiated with every request or would the bean instance be cached and used as a singleton (like the default in spring). I was unable

Camel - Stop route when the consuming directory not exists

心已入冬 提交于 2019-12-05 17:16:19
I've an SFTP route (in Spring XML), and its from path ends in a daily changing directory (ie. /yyyyMMdd), and everything is working well when autoCreate=true or the directory exists when the route starts. But it is not permitted to me to create the directory if not exists! When the dir exists, the route get files and terminates itself. When the dir not exists, the route is polling permanently with a warning (ie. org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change directory to: 20160917 ) and never stops. How can I avoid this behaviour (eg. convert the warning to

Error after upgrading camel-cxf to 2.15.2 . Class Cast exception

送分小仙女□ 提交于 2019-12-05 15:50:13
After upgrading to apache camel-cxf to 2.15.2 and cxf 3.0.4 I have the following problem when starting up my camel routes. The route does a soap integration with a Payment Gateway. Has any body found a workaround for this? Please see stack trace below. Caused by: javax.ejb.EJBException: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[cxf:// https://staging.payu.co.za/service/PayUAPI?dataFormat=PAYLOAD&portName=%7Bhttp%3A%2F%2Fsoap.api.controller.web.payjar.com%2F%7DEnterpriseAPISoapPort&serviceName=%7Bhttp%3A%2F%2Fsoap.api.controller.web

Camel SFTP - Cannot change directory to '/'

房东的猫 提交于 2019-12-05 15:06:21
I need to connect via SFTP to a server and I receive this error: INFO [org.apache.camel.component.file.remote.SftpOperations.connect]: **Connected to sftp://myserver.com:22** INFO [org.apache.camel.component.file.remote.RemoteFileProducer.connectIfNecessary]: **Connected and logged in to: Endpoint[sftp://myserver.com:22//home/tomcat/directory?password=******] INFO [org.apache.camel.component.file.remote.SftpOperations$JSchLogger.log]: JSCH -> **Caught an exception, leaving main loop due to Read timed out** INFO [org.apache.camel.component.file.remote.SftpOperations$JSchLogger.log]: JSCH -> *

Back to Basics : Apache Camel Routes and Direct Component

痞子三分冷 提交于 2019-12-05 14:31:46
I am bit confused about Camel routes and its two endpoints : Direct and Seda. Well let's say i have a route like this : public void configure() { from("direct:services") .process(//Some processing here) .to("http://ThirdPartyServers") } On top of this I have a rest web service which receives several requests, does some processing and then hands over the message to this route to get response from some third party servers. I have instantiated Camel Context through Spring framework like this : <camelContext id="appCamelContext" xmlns="http://camel.apache.org/schema/spring" trace="true"

Component camel-jsonpath gives error after adding to pom file

倖福魔咒の 提交于 2019-12-05 14:12:36
In a clean Camel project I add the following dependency: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jsonpath</artifactId> <version>2.16.1</version> </dependency> When I run the project I get the below error. If I remove that dependency it works. I have tried this on two different projects and the same happens. Anything else that has to be added to the pom for jsonpath to work? It seems to complain for ASM? [INFO] Using org.apache.camel.test.blueprint.Main to initiate a CamelContext [INFO] Starting Camel ... [mel.test.blueprint.Main.main()] Activator INFO Camel activator

Alternative to deprecated XmlJsonDataFormat in Apache Camel

瘦欲@ 提交于 2019-12-05 11:51:41
In Apache Camel, I was trying to use XmlJsonDataFormat to do a quick conversion from XML to JSON. However the XMLJSON ( http://camel.apache.org/xmljson.html ) has deprecated so I am not sure what is the best way to do that conversion aside from creating a processor. Does anyone know of an alternative to XmlJsonDataFormat? After some tries, I have managed to get what I need by combining Jaxb and Jackson for unmarshal XML to POJO and then POJO to JSON. As noMad pointed out, I could have tried Dozer ( http://camel.apache.org/dozer.html ) as well but haven't got time to do so. JacksonDataFormat

Websphere Liberty profile - transacted Websphere MQ connection factory

巧了我就是萌 提交于 2019-12-05 11:39:34
Trying to get my Liberty profile server to create a transacted jmsConnectionFactory to my instance of Websphere message queue. Liberty profile v 8.5.5.5 Websphere MQ 7.x I've tried to change the jmsQueueConnectionFactory to jmsXAQueueConnectionFactory but it does not help -> Then it seems to just ignore it and doesn't connect to the MQ server.xml <?xml version="1.0" encoding="UTF-8"?> <server description="new server"> <!-- Enable features --> <featureManager> <feature>wmqJmsClient-1.1</feature> <feature>jndi-1.0</feature> <feature>jsp-2.2</feature> <feature>localConnector-1.0</feature> <

Camel http4 and url-encoded passwords being interpreted as separate arguments

自古美人都是妖i 提交于 2019-12-05 10:26:12
We've got an Apache Camel (2.13.2) app that uses http4 to communicate with a webserver, using NTLM for auth. The endpoint is defined as (pseudo): ... .to("http4://thegreat.server.com/uri?authUsername=" + user + "&authPassword=" + pass + "&authenticationPreemptive=true&authMethod=NTLM&authDomain=DOMAIN&authHost=host") .to("otherEndpoint"); This works well as long as the pass variable contains "non-special" chars. However, if the pass contains for example "abcd&def" - Camel will intepret the ampersand as a query parameter separator, as it should. But url encoding the ampersand (i.e "abcd%26def"