apache-camel

Transaction not working with activemq + spring-integration + spring-jms

限于喜欢 提交于 2019-12-25 08:57:08
问题 My queue is not getting transacted. I want to that my message should again go in queue if any error occurs but message does not get transacted ( or does not again goes to the queue) Below is my camel configuration file <bean id="txManager" class="org.springframework.jms.connection.JmsTransactionManager"> <property name="connectionFactory" ref="amqConnectionFactory" /> </bean> <bean id="jasypt" class="org.apache.camel.component.jasypt.JasyptPropertiesParser"> <property name="password" value="*

Apache Camel- Message Redelivery happens before onexception block executes

两盒软妹~` 提交于 2019-12-25 07:53:47
问题 Have the following camel route. @Override public void configure() throws Exception { onException(java.lang.Exception.class).useOriginalMessage() .beanRef("discoveryService", "updateConnection") .redeliveryPolicyRef("redeliverMessagePolicy"); from(ENDPOINT_URI).to(queueName); } with Redelivery policy defined as following in xml- <redeliveryPolicyProfile id="redeliverMessagePolicy" retryAttemptedLogLevel="WARN" maximumRedeliveries="8" redeliveryDelay="${redeliveryDelay}" /> However when an

How to reload a properties file in Apache Camel 2.12?

青春壹個敷衍的年華 提交于 2019-12-25 06:58:15
问题 I want to do two things: Load a properties into a bean and update the bean when properties is updated. I use JBoss Fuse 6.1 where to install my application bundle and have a properties file on the server where I need to read some configuration. The properties have the follow line: mediaTypeList=JSON,DOCX,TXT And I have a Java Bean that is a mirror of the file property: public class MediatType { private List<String> mediaTypeList; // GETTERs and SETTERs } The property mediaTypeList indicate

because of No bean could be found in the registry of type: PlatformTransactionManager

筅森魡賤 提交于 2019-12-25 06:47:11
问题 I am trying to configure the spring transaction policy <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager"> </bean> <bean id="PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy"> <property name="transactionManager" ref="transactionManager" /> <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED" /> </bean> this is my exception Caused by: org.apache.camel.NoSuchBeanException: No bean could be

Apache Camel Tracer | Would log level make a difference in the amout of information logged

雨燕双飞 提交于 2019-12-25 06:26:19
问题 am exploring the usage of Tracer for logging purpose. It can be managed via JMX Console, so logging can be enabled even when developers haven't used logs in their routes. My concern is that Tracer seems to output the same amount of information irrespective of the log level set. Is this case or I am missing something. I am enabling tracing on the route in the Route Builder: getContext().setTracing(true); Date d = new Date(); from("file://c:/test?include=myTest.*.txt&noop=true").routeId(

how to access activemq jms custom header property; from camel route

≯℡__Kan透↙ 提交于 2019-12-25 04:42:45
问题 Please see this question first. How can I access that custom header property value from "queue2"?outside of that route builder method or class. I am using something like shown below. I dont find any methods in consumerTemplate API to get custom header properties. ConsumerTemplate consumerTemplate = camelContext.createConsumerTemplate(); textMessage = consumerTemplate.receiveBody("activemq:queue2",10000,String.class); that question is to set header using camel route. but this question about

JUnit Tests fail's ramdomly, Camel 2.15.1 Custom TypeConvertor not getting loaded

假如想象 提交于 2019-12-25 04:29:41
问题 JUnit Tests fail's randomly, Camel 2.15.1 Custom TypeConverter not getting loaded. I am currently having issues with custom TypeConverter not getting loaded, Unit tests are failing randomly. When I am trying to run them multiple times, sometimes the TypeConverter gets loaded and Unit Test pass and work as expected. Sometimes the TypeConverter is not found. message=exception: org.apache.camel.InvalidPayloadException: No body available of type: org.apache.commons.httpclient.methods

Camel not finding “sftp” component in registry and shutting down

▼魔方 西西 提交于 2019-12-25 04:10:47
问题 I'm using the camel-sftp component to upload a file to an SFTP server. The code is simple: File source = new File(path); final String sftpUri = "sftp://" + userId + "@" + serverAddress + "/" + remoteDirectory+"?password="+pwd; CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("file:/" + path).to(sftpUri); } }); context.start(); Thread.sleep(10000); context.stop(); However, camel has problems

Using header value as table name in Camel sql component

好久不见. 提交于 2019-12-25 03:58:15
问题 I would like to use the header value for setting the name of db table in sql component. Is there an easy way to do this? .to("sql:drop table ${in.header.tablename}") throws invalid character exception 回答1: If you want to route the message dynamically, you can use recipient-list. The route could be from("direct:a").recipientList(simple("sql:drop table ${in.header.tablename}")). 回答2: The point of using the sql component instead of the jdbc one is that the former allows you to use the message

Camel reverse proxy - no response stream caching

爷,独闯天下 提交于 2019-12-25 03:24:42
问题 I am trying to implement a memory efficient http reverse proxy that is only working on streams. The Jetty consumer places the input stream into the exchange and I can hook it up with a http producer to forward the request. No problem there. However, all http producers that I am aware of (Jetty, http4, netty-http) read the response stream into heap memory and place its contents into the exchange in some form or another instead of a handle to the stream. And none of them seem to offer an option