camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CAMEL-3358) Consumer template ignores options in uri for file consumer
Date Wed, 24 Nov 2010 07:21:25 GMT

     [ https://issues.apache.org/activemq/browse/CAMEL-3358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen resolved CAMEL-3358.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5.0
         Assignee: Claus Ibsen

You need Camel 2.5 which has this fixed

> Consumer template ignores options in uri for file consumer
> ----------------------------------------------------------
>
>                 Key: CAMEL-3358
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3358
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>         Environment: Debian sid i686
> sun jdk 1.6.0_22-b04
> apache-servicemix-4.2.0-fuse-02
>            Reporter: Pham Ngoc Hai
>            Assignee: Claus Ibsen
>             Fix For: 2.5.0
>
>
> I have an OSGi bundle:
> My camel-context.xml:
> ------------
> 	<osgi:camelContext xmlns="http://camel.apache.org/schema/spring">					
> 		<template id="producer" />
> 		<consumerTemplate id="consumer" />
> 		<routeBuilder ref="routeBuilder"/>
> 	</osgi:camelContext>
> 	<bean id="routeBuilder" class="com.proiam.postmarque.customer.RouteBuilder">	
> 	</bean>
> 	
> 	<bean id="customerFilePolling" class="com.proiam.postmarque.customer.CustomerFilePolling">
> 		<property name="pullAddress" value="${pullAddress}" />
> 	</bean>
> ------------------
> RouteBuilder:
> ------------------
> 		from("quartz://customer4pxfilein?cron=" + cronTime)		
> 		.beanRef("customer4PXFilePolling", "pollFiles");
> -----------------
> pollFiles:
> -----------------
> public class CustomerFilePolling {
> 	//@AutoWired gives me NPE
> 	@EndpointInject
> 	ConsumerTemplate consumer;
> 	//@AutoWired gives me NPE
> 	@EndpointInject
> 	ProducerTemplate producer;
>         public void pollFiles() {
> 		while (true) {
> 			//System.out.println("Prepare to comsume");
> 			Exchange exchange = consumer.receive("file:///tmp/test/in?move=../done&readLock=changed",
2000);
> 			if (exchange == null) {
> 				break;
> 			}
> 			Exchange result = producer.send("activemq:queue:CustomerFileInBody", exchange);
> 			if (result.isFailed()) {
> 				System.out.println("pollFiles processor raised an error!");
> 			}
> 		}
> 	}
> }
> --------------
> Everything is fine except that after being processed, the files are still there together
with their .camelLock 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message