apache-camel

MQ header - Identifier context - ApplIdentityData

北慕城南 提交于 2019-12-02 14:30:45
问题 We want to extract information from ApplIdentityData on MQ Header. But on the consumer side, we dont see corresponding JMS header for ApplIdentityData. I did trace on the logs and i dont find any information related to ApplIdentityData. I am using Apache Camel to read the MQ and process the Queue Message. In the camel trace logs, i dont find anything to ApplIdentityData. Could you please help me ? Below is the MQ Message Header and Camel File : StrucId : 'MD ' Version : 2 Report : 0 MsgType :

Apache Camel + Spring (war) + Tomcat + REST

做~自己de王妃 提交于 2019-12-02 13:08:43
I am trying to develp a rest service using apache camel. My project is a spring mvc war deployed on tomcat. I dont want to use apache cxf (cxf servlet). public class SampleRouter extends RouteBuilder { @override public void configure() throws Exception { from("cxfrs://http://localhost:1234/sample") .process (new Processor() { public void process(Exchange exchange) throws Exception { System.out.println("test"); } })).setBody(constant("SUCCESS")); } } @Path("/sample") public class SampleResource { @GET public void test() { } } web.xml has dispatcherservlet, contextloaderlistener. dispatcher

Why is my Camel Netty route adding newlines to the start of my JMS messages?

断了今生、忘了曾经 提交于 2019-12-02 12:46:22
I have a Camel Netty route that takes XML sent to a server port and places it in a JMS message. After the first message, every other message has a newline at the top of the message, causing my XML to fail to unmarshall when a GUI receives it. My route look like this: <route> <from uri="netty4:tcp://localhost:5150?decoders=#customFrameDelimeterDecoder,#string-decoder&encoder=#string-encoder"/> <to uri="jms:topic:my.company.topic"/> </route> Note: The XML is not newline terminated, hence the need for a custom frame delimeter decoder. Try setting: <from uri="netty4:tcp://localhost:5150?textline

Apache Camel: Reply received for unknown correlationID

半城伤御伤魂 提交于 2019-12-02 12:36:53
问题 There is a middleware in between of two other software components. In the middleware I'm routing Apache ActiveMQ messages by Apache Camel . this is how it works: 1stComponent uses middleware to send message to the 3rdComponent 3rdComponent replies the message and sends it back to the 1st (using middleware ). 1stComponent <<=>> Middleware <<=>> 3rdComponent Problem: I'm using ConcurrentConsumers in middleware. In the middle of sending a lot of messages sequentially, suddenly middleware stops

Apache Camel: Do I need to make my FTP-Consumer route transactional?

烂漫一生 提交于 2019-12-02 12:30:42
I have these FTP endpoint properties: include=.*.xml&delay=60s&consumer.bridgeErrorHandler=true&throwExceptionOnConnectFailed=true&binary=true&move=.done&soTimeout=300000 So an endpoint need to search every 60 secounds the *.xml files and consume it. After that the files will be proceed and moved in 'done' directory. I'm afraid that if f.e. by doing the move of a file an IOException occures, the file will already be deleted from the endpoint root directory. The question is: do I need to make my FTP-Consumer route transactional? Another question is: can you give an advise to add another usefull

Split file into multiple files

孤者浪人 提交于 2019-12-02 11:24:14
I want to cut a text file. I want to cut the file 50 lines by 50 lines. For example, If the file is 1010 lines, I would recover 21 files. I know how to count the number of files, the number of lines but as soon as I write, it's doesn't work. I use the Camel Simple (Talend) but it's Java code. private void ExtractOrderFromBAC02(ProducerTemplate producerTemplate, InputStream content, String endpoint, String fileName, HashMap<String, Object> headers){ ArrayList<String> list = new ArrayList<String>(); BufferedReader br = new BufferedReader(new InputStreamReader(content)); String line; long

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

雨燕双飞 提交于 2019-12-02 10:26:16
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 Aha! I see what you are trying to do here. Simple expressions won't work that way with a Polling Consumer like File2 . If you are using Camel 2.16+, you

Camel saves full http request but I want only attached file

心已入冬 提交于 2019-12-02 10:18:31
I have the following code base: @Component public class DummyRoute extends RouteBuilder { @Override public void configure() throws Exception { rest("/upload").post().to("file://rest_files"); } @Bean public ServletRegistrationBean servletRegistrationBean() { SpringServerServlet serverServlet = new SpringServerServlet(); ServletRegistrationBean regBean = new ServletRegistrationBean( serverServlet, "/rest/*"); Map<String,String> params = new HashMap<>(); params.put("org.restlet.component", "restletComponent"); regBean.setInitParameters(params); return regBean; } @Bean public org.restlet.Component

Content-Type is not supported in Camel DELETE method?

旧巷老猫 提交于 2019-12-02 10:17:07
How do i send content-type in Camel DELETE method. I have added the following way but It was not working correctly. from("direct:start") .setHeader(Exchange.HTTP_METHOD, simple("DELETE")) .setHeader(Exchange.CONTENT_TYPE, simple("application/xml")) .setHeader(Exchange.HTTP_URI, simple("http://02.02.02.02:8080/rest/delete/student/688187")) .to("http://emptyhost"); Could you please help me to resolve this issue? Peter Keller As in a delete operation, no content is sent, the Exchange.CONTENT_TYPE property should not be needed. Please, try from("direct:start") .setHeader(Exchange.HTTP_METHOD,

How to update camel properties externally?

ε祈祈猫儿з 提交于 2019-12-02 10:12:01
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? Update: Exemple of use case:when a remote server doesn't return response, we keep sending messages until we