apache-camel

Using Apache Camel ProducerTemplate in Apache Storm bolt

浪尽此生 提交于 2019-12-12 16:10:13
问题 I'm trying to write simple Storm + Camel project. My Storm topology analyzes tweets and one bolt should send tweet text to apache camel route, which in turn is using websocket to notify some webapp. I cannot make it work due to NotSerializableExceptions received from bolts when trying to use build once CamelContext. What I've already tried: pass CamelContext in bolt's constructor - results in NotSerializableException pass CamelContext in storm conf, and use it in bolt's prepare(...) method to

apache camel jcr jackrabbit

送分小仙女□ 提交于 2019-12-12 14:21:55
问题 I'm new in camel world and I have problems making a connection with the jcr component. look at my test code: import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.jcr.JcrConstants; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; public class ObjectToJCRRouteTest extends CamelTestSupport { @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception

Trouble using power mock with camel

[亡魂溺海] 提交于 2019-12-12 14:19:47
问题 Since I have to mock a static method, I am using Power Mock to test my application. My application uses * Camel 2.1 *2. I define routes in XML that is read by camel-spring context. There were no issues when Junit alone was used for testing. While using power mock, I get the error listed at the end of the post. I have also listed the XML used. Camel is unable to recognize any of its tags when power mock is used. I wonder whether the byte-level manipulation done by power mock to mock static

Sending message to Weblogic JMS Queue from a Camel Route

故事扮演 提交于 2019-12-12 14:11:17
问题 I am trying to put a message on a Queue in Weblogic JMS, via a Camel Route. My aim is to eventually configure a Route to consume the messages from the jms queue to which I publish the data from the earlier Route. Here is my config: <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop> <prop key="java.naming.provider.url">t3://localhost:7001</prop> <!--

how to read only specific queue messages based on message header property

北城以北 提交于 2019-12-12 14:04:27
问题 I have a list of messages in activemq queue. each message has a custom header property with value. How I should be able to access only those messages whose custom header property value = 123.? I am using something like below to pick a message from queue. How to pick all messages which or a single message which has customHeaderProperty =123.? ConsumerTemplate consumerTemplate = camelContext.createConsumerTemplate(); Exchange ex = consumerTemplate.receive("activemq:queueName",10000); String

Camel Quartz route undesired job execution at route startup

你离开我真会死。 提交于 2019-12-12 14:01:58
问题 I have several routes that looks like : from("quartz://" + getJobId() + "?cron=" + cronExpression + "&stateful=true") .routeId(getJobId()) .autoStartup(false) .to(getRouteTo()); Those routes can be started and stopped from an administration console. The problem I have is the following: If a route is configured to run everyday at 17:00, currently if my route is started after 17:00, quartz notice that it should have run at 17:00 and will try to recover that missed execution. I don't want that

Apache Camel timeout synchronous route

我怕爱的太早我们不能终老 提交于 2019-12-12 10:17:52
问题 I was trwing to construct a synchronous route with timeout using Apache Camel, and I couldn't find anything in the framework with resolve it. So I decided to build a process with make it for me. public class TimeOutProcessor implements Processor { private String route; private Integer timeout; public TimeOutProcessor(String route, Integer timeout) { this.route = route; this.timeout = timeout; } @Override public void process(Exchange exchange) throws Exception { ExecutorService executor =

Apache Camel concurrentConsumers vs threads

假如想象 提交于 2019-12-12 09:54:45
问题 i spent almost two days to understand the concept concurrentConsumers vs threads in Apache Camel. but i really don't understand the concept. could anyone help me to understand the concept. I am using camel 2.12.0. from("jms:queue:start?concurrentConsumers=5") .threads(3, 3, "replyThread") .bean(new SomeBean()); pom.xml ========================================== <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <camel.version>2.12.0</camel.version> </properties>

Apache Camel REST DSL - Validating Request Payload and return error response

吃可爱长大的小学妹 提交于 2019-12-12 09:11:13
问题 I am exposing a rest service using "CamelHttpTransportServlet" that receive orders and place in jms queue. The code works fine on happy path and returns 200 response. I have written Processor to validate the input JSON, and set http_response_code based on the input. The issue is - for invalid requests though failure response code - 400 is set, the flow continues to the next route and pushes the data to the queue instead of sending the 400 response back to the calling app. rest("

Camel aggregation strategy

落花浮王杯 提交于 2019-12-12 09:10:41
问题 I am parsing a CSV file, splitting it and routing it through multiple processors in camel. There are two endpoints , one having erroneous data while other has validated data. I need suggestion in aggregating the data. Let's say the CSV file has 10 records out of which 6 reached one endpoint while 4 reached to another. How can I know if all 10 has completed from the file at each endpoint and move ahead of aggregator. I need to create two files one with valid data and other with corrupt data