apache-camel

How to set value for antInclude attribute from exchange property in apache camel

我的未来我决定 提交于 2019-12-20 06:28:33
问题 I am adding a property to exchange at runtime from the request. exchange.setProperty("filePattern", String.format("*%s*", routeConfig.getFilePattern())) Later, I am trying use the property for antInclude attribute as below file:source?readLock=changed&antInclude=${exchangeProperty.filePattern} Above code is not working, route created as below during runtime in log file://source?antInclude=%24%7BexchangeProperty.filePattern%7D&readLock=changed 回答1: Aha! I see what you are trying to do here.

How to update camel properties externally?

匆匆过客 提交于 2019-12-20 06:25:49
问题 Im developping non OSGI app and i need to update the values ​​of some properties used in camel routes (loaded BridgePropertyPlaceHolder). So I thought: To use Hawtio, the cool mangement console, in order update camel using JMX Create a JMX MBean that will update the properties .. I successfully create the MBean operations and call them using JMX, but I can't figure out how to update the camel routes that depends on these properties. Is there a way to update the camel context externally?

Camel RaabitMQ Acknowledgement

試著忘記壹切 提交于 2019-12-20 05:54:41
问题 I am using Camel for my messaging application. In my use case I have a producer (which is RabbitMQ here), and the Consumer is a bean. from("rabbitmq://127.0.0.1:5672/exDemo?queue=testQueue&username=guest&password=guest&autoAck=false&durable=true&exchangeType=direct&autoDelete=false") .throttle(100).timePeriodMillis(10000) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { MyCustomConsumer.consume(exchange.getIn().getBody()) } }); Apparently, when

Proxy authentication with Camel using ProducerTemplate

℡╲_俬逩灬. 提交于 2019-12-20 05:43:08
问题 I have a project that's using Camel and running on a ServiceMix server, but I can't seem to get it to access external web services, and I suspect it's because I can't set the proxy authentication properly. Exchange exchange = producerTemplate.request(url, new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader(Exchange.HTTP_METHOD, "POST"); exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/json"); } }); response = exchange.getOut()

How to send message to different Queue hosted in different queue manager and hostname in IBM MQ cluster

杀马特。学长 韩版系。学妹 提交于 2019-12-20 04:58:11
问题 My Apache-camel based app is consuming message from one of IBM queue, for e.g. below is the details for connection factory hostname=host1000 QManager=QM1000 Port="some port" Channel="common channel" Camel flow to consume and process and send the response to ReplyQueue which is coming from message header. from(wmq:queue:<INPUT_QUEUE>) .bean("processBean") .bean("beanToSendMsgToReplyQueue") In camel header I am getting below JMSReplyQueue. You can see that it's a different Queue manager and

org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type:

梦想与她 提交于 2019-12-20 04:19:19
问题 I have multipart file in the first place and I want to send it to camel pipeline and save this file with original name. my code: @Autowired ProducerTemplate producerTemplate; ... producerTemplate.sendBody("seda:rest_upload", multipartFile); on another side I have: from("seda:rest_upload").convertBodyTo(File.class).to("file://rest_files"); And also I try to register converter: @Converter public class MultiPartFileToFileConvertor { @Converter public static File toFile(MultipartFile

How to set ApplicationIdData using MQQueueConnectionFactory?

亡梦爱人 提交于 2019-12-20 04:04:21
问题 Trying to figure out the camel/Spring configuration to set ApplicationIdData using JMS. I know the java way to do it as below, I set MQOO_SET_IDENTITY_CONTEXT using below int putOptions = MQConstants.MQPMO_SET_IDENTITY_CONTEXT; pmo.options =putOptions; and then i set applicationIdData as: MQMessage msg = new MQMessage(); msg.applicationIdData = "SomeId"; msg.writeString(qmessage); queue.put(msg, pmo); Question is, How do I set applicationIdData using JMS/camel/Spring configuration . Below is

Size Limit of camel header variable and property

。_饼干妹妹 提交于 2019-12-20 03:53:21
问题 I have to store the request xml in to database. I was using header variable to do that. exchange.getIn().setHeader("inputRequestXml", body); it was working for some files And I was getting below exception for some files, it seems like because of the file size. 413 Request entity too large So I have changed the implementation by using camel property, like below exchange.setProperty("inputRequestXml", body); Now I am not getting the exception. But I am afraid that will it handle the bigger

Camel: changing stream encoding

本小妞迷上赌 提交于 2019-12-20 03:39:05
问题 I'm receiving data stream from http with that route: from("direct:foo"). to("http://foo.com/bar.html"). to("file:///tmp/bar.html") HTTP stream comes with Windows-1251 encoding. I'd like to re-code to UTF-8 on the fly and then store to file. How to do that using standard camel way? 回答1: Please have a look at .convertBodyTo() - in particular the charset argument. from("direct:foo"). to("http://foo.com/bar.html"). convertBodyTo(String.class, "UTF-8") to("file:///tmp/bar.html") Reference: http:/

Apache Camel endpoint to write a file AS400 FTP :

别说谁变了你拦得住时间么 提交于 2019-12-20 03:37:10
问题 I am trying to write a file to AS400 FTP via camel endpoint as below ftp://user@host:21/QSYS.LIB/XINFT.LIB?password=password&passiveMode=true ftp://user@host:21/QSYS.LIB/XINFT.LIB?password=password But the write operation fails with the following exception Cannot change directory to: QSYS.LIB. Code: 550. Processed by failure processor: FatalFallbackErrorHandler[Pipeline[[Channel[Wrap[com.privasia.edi.core.routing.exception.CustErrorHandler@2003b7bd] -> com.privasia.edi.core.routing.exception