Re: camel-blueprint.xsd is not updated

2015-02-25 Thread Willem Jiang
We need to do it manually, I will take care of it today.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On February 24, 2015 at 9:53:43 PM, yogu13 (yog...@gmail.com) wrote:
> Hi,
>  
> I see that the camel-blueprint.xsd available @
> http://camel.apache.org/schema/blueprint/ is not updated with the blueprint
> changes for recent released for camel (2.14.1). It was last synched with the
> version 2.13.0.
>  
> Any specific reason for this or can i raise a JIRA and provide a patch for
> the same if it has to be done manually?
>  
>  
> Regards,
> -Yogesh
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-blueprint-xsd-is-not-updated-tp5763118.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Failover with Camel CXF

2015-02-25 Thread Willem Jiang
Hi,

You need to specify the LoadBalanceType such as Failover or roundRobin.
You can find more information here[1]

[1]https://camel.apache.org/load-balancer.html

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On February 25, 2015 at 7:57:00 PM, sayed_india (sayed.abdulis...@gmail.com) 
wrote:
> Hi,
> I followed the instructions provided but unable to implement shows the
> error:
> [LoadBalanceType[ref:null... because of ref or loadBalancer must be
> specified.
>  
> Please find below code snippet and correct me where I go wrong with this.
>  
> WSDL
> --
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> --
> Endpoint config:
>  
> > serviceClass="camelinaction.order.OrderEndpoint"
> wsdlURL="wsdl/order.wsdl">
>  
> > serviceClass="camelinaction.order.OrderEndpoint"
> wsdlURL="wsdl/order.wsdl">
>  
> > serviceClass="camelinaction.order.OrderEndpoint"
> wsdlURL="wsdl/order.wsdl">
>  
>  
> Camel Route:
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> OK
>  
>  
>  
> Appreciate a quick response.
>  
> Thanks and Regards,
> Sayed
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Failover-with-Camel-CXF-tp5723454p5763151.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



RE: camel-metrics Component

2015-02-25 Thread vivekt
Hello Claus, I tested Jim's orginal Java class with 2.14.1, but still could
not get the metrics from MetricsRegistryService.

When I invoke dumpStatisticsAsJson() , all the metrics are empty.
Here is the output

"version" : "3.0.0",
  "gauges" : { },
  "counters" : { },
  "histograms" : { },
  "meters" : { },
  "timers" : {
"camel-1:testroute.responses" : {
  "count" : 3,
  "max" : 25.073,
  "mean" : 9.5436665,
  "min" : 1.5678,
  "p50" : 1.99,
  "p75" : 25.073,
  "p95" : 25.073,
  "p98" : 25.073,
  "p99" : 25.073,
  "p999" : 25.073,
  "stddev" : 13.450452272445464,
  "m15_rate" : 0.558194480485237,
  "m1_rate" : 0.20307925506404548,
  "m5_rate" : 0.48311899441084233,
  "mean_rate" : 0.042752986809164464,
  "duration_units" : "milliseconds",
  "rate_units" : "calls/second"
}
  }
}

My application uses blueprint and I want to expose the counters so that I
can access the metrics via Hawtio

In blueprint.xml, I have declared the bean as 




 

In Hawtio interface, I do see the Mbean service but it does not have any
counters in the output.

Could you please let me know if the issue is fixed in 2.14.1?
Is there something that I am missing?

Thanks,

Vivek



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-metrics-Component-tp5758627p5763182.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Async IdempotentRepository

2015-02-25 Thread Behrad
Does camel support of any IdempotentRepository SPI that has async methods
unlike
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/spi/IdempotentRepository.java
?

I have implemented above interface on top of Couchbase API however I  am
using `Await` to block futures to send back add/remove/contains results and
this is not currently provide the concurrency/performance we need on high
load.



-- 
--Behrad


RE: SFTP file process order

2015-02-25 Thread shreyas
But that has null as default option. So, what is the default behavior? And what 
about SFTP concurrent file download if there are multiple files?


Thanks
Shreyas



> From: dewitte...@gmail.com
> Date: Wed, 25 Feb 2015 08:20:45 +
> Subject: Re: SFTP file process order
> To: users@camel.apache.org
>
> Hi,
>
> I think sorter and sortBy are the options you are looking for.
> http://camel.apache.org/file2.html
>
> Best regards
> Pierre-Alban
>
> Le Tue Feb 24 2015 at 20:38:23, shreyas  a
> écrit :
>
>> Hello,
>>
>> Is anyone aware of default file process order in SFTP component? I am
>> downloading files from SFTP server to local disk using readchange strategy.
>> What happens if multiple files are put in the SFTP server. Are they
>> processed in datetime order or some other order. I did look into file2
>> consumer but did not read anything about process order.
>>
>> Also, is SFTP download's concurrent? I know FTP is not, but what about
>> SFTP.
>>
>> Thanks in advance,
>> Shreyas Purohit
  

Invoking existing spring jms listener through camel routes.

2015-02-25 Thread Sag21
Spring exposes the jmsListener part like below







So how to call this through Camel as a different service in camel routes.


My aim is to decouple the listener part service which can be used in future
to use anywhere in camel path.
I tried to invoke spring listener for inbound JMS message in camel route
below and removed the 
line from  but not successful.











Any pointers will really help. Thanks in advance guys for help.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Invoking-existing-spring-jms-listener-through-camel-routes-tp5763179.html
Sent from the Camel - Users mailing list archive at Nabble.com.


how to Mock camel EL ?

2015-02-25 Thread student.cologne
hi at all. i am new in camel. i need a support in the thema junit test for
camel.so, i have this configuration:
FetchPreprocessingResultFromMarklogicRoute.java

 
to get it run i have created a junit test:
FetchPreprocessingResultFromMarklogicRoute_Test.java

 
so the problem is an Camel EL. I don't now how can i replace the
expressionwith Mock, or is there other solution ?



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-Mock-camel-EL-tp5763174.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Getting HTTP status code as 202 always and want to override with the 200.

2015-02-25 Thread Sag21
New to camel.I have existing spring application which has soap endpoints. The
return type of soap endpoint is jdom Element.
When the processing of endpoint completes I am calling the camel processors
in routes - one for Acknowledgement and other for putting in JMS. 
Once its done returning me response as 202 which is correct but how to
override that to 200.

Tried in last processor i.e. when I put my message in JMS after that it will
end my camel route.Tried these things 1. Used getOut 2. Used getIn. 3.Used
after last processor in camel route.

1.  exchange.getOut.setHeader(Exchange.HTTP_RESPONSE_CODE,200)
Response r = Response.status(200).entity("Created").build();
exchange.getOut().setBody(r);

2. exchange.getIn.setHeader(Exchange.HTTP_RESPONSE_CODE,200)
Response r = Response.status(200).entity("Created").build();
exchange.getIn().setBody(r);
3. 200

When I was debugging my code after completion of camel its checking for this 
 else if (exchange.getPattern().isOutCapable()) {
Message responseMessage = exchange.getOut(Message.class);
if (responseMessage != null) {
Source responseBody = responseMessage.getBody(Source.class);
WebServiceMessage response = messageContext.getResponse();


so tried to put the few more line of code in processor to fulfil above
request assuming my body will have Source Element.

Message msg = exchange.getIn();
exchange.setOut(msg)
exchange.getOut.setBody(exchange.getIn().getBody())

I need some pointer if someone already faced this issue. Appreciate your
help and time.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Getting-HTTP-status-code-as-202-always-and-want-to-override-with-the-200-tp5763173.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel blueprint support multiple mail boxes ???

2015-02-25 Thread Gary
Hi Yogu13, 

thanks!!! 
ok, I think I get it, if I use the Java DSL I have more scalability because
the config files or the xml's do not support multiple configuration
entries??? Sorry if I am a bit behind, learning on overload, arg!

thanks again,
Gary



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126p5763168.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to trap most specific exceptions?

2015-02-25 Thread Claus Ibsen
Hi

If you have a copy of Camel in Action its explained in much detail in chapter 5.
You may find some information on the Camel doc website as well, but
not as deep as in the book.

On Mon, Feb 23, 2015 at 5:15 PM, toomanyedwards
 wrote:
> Thanks for the pointer.  Can you give some insight into why Camel matches
> from the bottom up of the exception chain rather from the top?  This appears
> to be an explicit design decision and it'd be useful to know the rationale
> behind it to help leverage exception trapping more effectively.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-trap-most-specific-exceptions-tp5762994p5763086.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: java.util.zip.ZipException: error in opening zip file

2015-02-25 Thread Gonzalo Vásquez Sáez
Thanks, we'll try downgrading to Camel 2.13.3 (just pom.xml fixing needed)


Atentamente / Regards,

Gonzalo Vásquez Sáez
gvasq...@waypoint.cl
+56 (2) 29634180
Director I+D / R&D Director
Waypoint Telecomunicaciones S.A.

Alfredo Barros Errázuriz 1953 Of. 1004
7500550
Providencia, Santiago, Chile
Mapcode: R3.BR









> El 25-02-2015, a las 11:16, Claus Ibsen  escribió:
> 
> Hi
> 
> Check the bottom of the release notes and you can find which version
> that dropped java 6. Which is indeed 2.14.x
> http://camel.apache.org/camel-2140-release.html
> 
> So try with 2.13.x
> 
> On Wed, Feb 25, 2015 at 3:14 PM, Gonzalo Vásquez Sáez
>  wrote:
>> Thanks Claus for such a fast answer!
>> 
>> Regarding Java versions, we'll try to install a Java 7 or 8 in that Linux 
>> box, but as an alternate approach, which Camel version DOES support Java 6 
>> so we could try that approach too?
>> 
>> Atentamente / Regards,
>> 
>> Gonzalo Vásquez Sáez
>> gvasq...@waypoint.cl
>> +56 (2) 29634180
>> Director I+D / R&D Director
>> Waypoint Telecomunicaciones S.A.
>> 
>> Alfredo Barros Errázuriz 1953 Of. 1004
>> 7500550
>> Providencia, Santiago, Chile
>> Mapcode: R3.BR
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> El 25-02-2015, a las 11:10, Claus Ibsen  escribió:
>>> 
>>> Camel 2.14.x does not support Java 6. You must use Java 7 or 8.
>>> 
>>> On Wed, Feb 25, 2015 at 3:02 PM, Gonzalo Vásquez Sáez
>>>  wrote:
 Hi everybody,
 
 I’m using Camel 2.14.1, mainly to use a timer and an http consumer 
 (URL_FLEET_HISTORY), as shown on the following Java code:
 
 @Override
   public void configure() throws Exception {
 
   from("timer:ws?period=" + period)
   .process(new Processor() {
 
   @Override
   public void process(Exchange exchange) throws Exception {
   Calendar cal = Calendar.getInstance();
   System.out.println("Searching new data @ "
   + cal.getTime());
   cal.add(Calendar.HOUR, -48);
   System.out.println("Since " + cal.getTime());
   String lastReport = 
 LAST_REPORT_DATE_FORMAT.format(cal
   .getTime());
   exchange.getOut().setHeader("lastReport", 
 lastReport);
 
   }
   })
   .recipientList(
   simple(URL_FLEET_HISTORY + USERNAME + SLASH + 
 PASSWORD
   + SLASH + "${header.lastReport}"))
   .convertBodyTo(String.class)
   .log(LoggingLevel.INFO, logger, "Data Received: ${body}")
   .split().tokenizePair("", "", true)
   .process(new LocationProcessor());
   }
 
 I’m also using org.apache.camel.main.Main to run the process as a command 
 line forever running kind of daemon. with this code:
 
 public class Listener {
 
   public static void main(String[] args) throws Exception {
   Listener daemon = new Listener();
   daemon.boot();
   }
 
   private Main main;
 
   public void boot() throws Exception {
   // create a Main instance
   main = new Main();
   // enable hangup support so you can press ctrl + c to terminate the 
 JVM
   main.enableHangupSupport();
 
   // add routes
   main.addRouteBuilder(new SkyPatrolRouteBuilder());
 
   // run until you terminate the JVM
   System.out.println("Starting Listener. Use Ctrl + c to terminate.");
   main.run();
   }
 
 }
 
 After a few days running the HTTP consumer starts to fail consistently 
 with the following stacktrace:
 
 228243785 [Camel (camel-1) thread #0 - timer://ws]  ERROR 
 org.apache.camel.processor.DefaultErrorHandler - Failed delivery for 
 (MessageId: ID-Monitor-59190-1424577519856-0-184780 on ExchangeId: 
 ID-Monitor-59190-1424577519856-0-184781). Exhausted after delivery 
 attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception 
 occurred during execution on the exchange: Exchange[Message: [Body is 
 null]]
 
 Message History
 ---
 RouteId  ProcessorId  Processor
 Elapsed (ms)
 [route1] [route1] [timer://ws?period=18
   ] [41 
 ]
 [route1] [process1  ] 
 [cl.waypoint.monitor.skypatrol.SkyPatrolRouteBuilder$1@549b6220
 ] [ 1]
 [route1] [recipientList1   

Re: java.util.zip.ZipException: error in opening zip file

2015-02-25 Thread Claus Ibsen
Hi

Check the bottom of the release notes and you can find which version
that dropped java 6. Which is indeed 2.14.x
http://camel.apache.org/camel-2140-release.html

So try with 2.13.x

On Wed, Feb 25, 2015 at 3:14 PM, Gonzalo Vásquez Sáez
 wrote:
> Thanks Claus for such a fast answer!
>
> Regarding Java versions, we'll try to install a Java 7 or 8 in that Linux 
> box, but as an alternate approach, which Camel version DOES support Java 6 so 
> we could try that approach too?
>
> Atentamente / Regards,
>
> Gonzalo Vásquez Sáez
> gvasq...@waypoint.cl
> +56 (2) 29634180
> Director I+D / R&D Director
> Waypoint Telecomunicaciones S.A.
>
> Alfredo Barros Errázuriz 1953 Of. 1004
> 7500550
> Providencia, Santiago, Chile
> Mapcode: R3.BR
>
>
>
>
>
>
>
>
>
>> El 25-02-2015, a las 11:10, Claus Ibsen  escribió:
>>
>> Camel 2.14.x does not support Java 6. You must use Java 7 or 8.
>>
>> On Wed, Feb 25, 2015 at 3:02 PM, Gonzalo Vásquez Sáez
>>  wrote:
>>> Hi everybody,
>>>
>>> I’m using Camel 2.14.1, mainly to use a timer and an http consumer 
>>> (URL_FLEET_HISTORY), as shown on the following Java code:
>>>
>>> @Override
>>>public void configure() throws Exception {
>>>
>>>from("timer:ws?period=" + period)
>>>.process(new Processor() {
>>>
>>>@Override
>>>public void process(Exchange exchange) throws Exception {
>>>Calendar cal = Calendar.getInstance();
>>>System.out.println("Searching new data @ "
>>>+ cal.getTime());
>>>cal.add(Calendar.HOUR, -48);
>>>System.out.println("Since " + cal.getTime());
>>>String lastReport = 
>>> LAST_REPORT_DATE_FORMAT.format(cal
>>>.getTime());
>>>exchange.getOut().setHeader("lastReport", 
>>> lastReport);
>>>
>>>}
>>>})
>>>.recipientList(
>>>simple(URL_FLEET_HISTORY + USERNAME + SLASH + 
>>> PASSWORD
>>>+ SLASH + "${header.lastReport}"))
>>>.convertBodyTo(String.class)
>>>.log(LoggingLevel.INFO, logger, "Data Received: ${body}")
>>>.split().tokenizePair("", "", true)
>>>.process(new LocationProcessor());
>>>}
>>>
>>> I’m also using org.apache.camel.main.Main to run the process as a command 
>>> line forever running kind of daemon. with this code:
>>>
>>> public class Listener {
>>>
>>>public static void main(String[] args) throws Exception {
>>>Listener daemon = new Listener();
>>>daemon.boot();
>>>}
>>>
>>>private Main main;
>>>
>>>public void boot() throws Exception {
>>>// create a Main instance
>>>main = new Main();
>>>// enable hangup support so you can press ctrl + c to terminate the 
>>> JVM
>>>main.enableHangupSupport();
>>>
>>>// add routes
>>>main.addRouteBuilder(new SkyPatrolRouteBuilder());
>>>
>>>// run until you terminate the JVM
>>>System.out.println("Starting Listener. Use Ctrl + c to terminate.");
>>>main.run();
>>>}
>>>
>>> }
>>>
>>> After a few days running the HTTP consumer starts to fail consistently with 
>>> the following stacktrace:
>>>
>>> 228243785 [Camel (camel-1) thread #0 - timer://ws]  ERROR 
>>> org.apache.camel.processor.DefaultErrorHandler - Failed delivery for 
>>> (MessageId: ID-Monitor-59190-1424577519856-0-184780 on ExchangeId: 
>>> ID-Monitor-59190-1424577519856-0-184781). Exhausted after delivery attempt: 
>>> 1 caught: org.apache.camel.CamelExecutionException: Exception occurred 
>>> during execution on the exchange: Exchange[Message: [Body is null]]
>>>
>>> Message History
>>> ---
>>> RouteId  ProcessorId  Processor 
>>>Elapsed (ms)
>>> [route1] [route1] [timer://ws?period=18 
>>>  ] [41 
>>> ]
>>> [route1] [process1  ] 
>>> [cl.waypoint.monitor.skypatrol.SkyPatrolRouteBuilder$1@549b6220 
>>>] [ 1]
>>> [route1] [recipientList1] [recipientList[simple{Simple: 
>>> http://wsp.skypatrol.com/fleet_history/waypointch] 
>>>  [42]
>>>
>>> Exchange
>>> ---
>>> Exchange[
>>>Id  ID-Monitor-59190-1424577519856-0-184781
>>>ExchangePattern InOnly
>>>Headers 
>>> {breadcrumbId=ID-Monitor-59190-14245775

Re: Camel File outputType as StreamList

2015-02-25 Thread Claus Ibsen
Hi

You can use the max messages per poll to limit the number of files
which could allow the consumer to process files sooner.

On Tue, Feb 24, 2015 at 12:32 PM, Dewitte P-Alban  wrote:
> Hi everybody
>
> Is it possible to read recursively a directory and output file names
>  (and/or content) in a streamList like the outputytpe paramater for the
> JDBC component.
>
> I had to process large directories with many file. Right now my route
> recurse in all sub directories before starting to process each file. i
> would like to find a solution to start processing file right after file
> componant find it.
>
> Here is a example :
>
> public class FileScan {
>
> public static void main(String[] args) throws Exception {
>
>
> FileScan example = new FileScan();
> example.boot();
> }
>
> public void boot() throws Exception {
> // create a Main instance
> Main main = new Main();
> // enable hangup support so you can press ctrl + c to terminate the 
> JVM
> main.enableHangupSupport();
> main.addRouteBuilder(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("file:C:\\Temp?noop=true&recursive=true&readLock=none")
> .routeId("FileScanner").process(new Processor() {
> @Override
> public void process(Exchange exchange) throws Exception {
> System.out.println("Reading
> "+exchange.getIn().getHeader("CamelFilePath"));
> }
> });
> }
> });
>
> // run until you terminate the JVM
> System.out.println("Starting Camel. Use ctrl + c to terminate
> the JVM.\n");
> main.run();
> }
>
> }
>
> Best regards
>
> Pierre-Alban



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Upgrading to Camel 2.14.1 and CompositeRegistry issue

2015-02-25 Thread Claus Ibsen
Hi

This sounds like a mixed versions of Camel on the classpath. So double
check that you use the same Camel version for all your camel jars.

On Wed, Feb 25, 2015 at 1:18 PM, geppo  wrote:
> Hi, I'm trying to upgrade some legacy code to use Camel 2.14.1, but I'm
> getting an AbstractMethodError when the method lookupByNameAndType is
> called. Any idea what this means and/or how I can fix it?
> Many thanks!
>
> Caused by: org.apache.camel.NoSuchBeanException: Cannot lookup: properties
> from registry: myUtils.camel.guice.GuiceRegistry@2ba95c45 with expected
> type: class org.apache.camel.component.properties.PropertiesComponent due:
> null
> at
> org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:62)
> at
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByNameAndType(PropertyPlaceholderDelegateRegistry.java:63)
> at
> org.apache.camel.util.CamelContextHelper.lookupPropertiesComponent(CamelContextHelper.java:492)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1891)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1767)
> at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1735)
> at myUtils.camel.MyService.start(MyService.java:19)
> ... 5 more
> Caused by: java.lang.AbstractMethodError
> at
> org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:56)
> ... 12 more
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Upgrading-to-Camel-2-14-1-and-CompositeRegistry-issue-tp5763152.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Camel Netty Http: HttpHeaders case sensitive

2015-02-25 Thread Claus Ibsen
Hi

Well spotted. Yeah you are welcome to log a ticket. And also we love
contributions so a patch with a fix is also welcome.
http://camel.apache.org/contributing.html

On Wed, Feb 25, 2015 at 1:57 PM, cgiera  wrote:
> Hello,
>
> we are implementing a http camel route for receiving data from SAP.
> The route consumes from a netty-http endpoint(from("netty-http...")).
>
> Our tests with SoapUi worked fine, but when we tried sending data from the
> SAP system the test failed with http 400 bad request.
> After some research I found https://issues.apache.org/jira/browse/CAMEL-6599
> where is mentioned to check if the host appears as http header.
>
> I analyzed the http requests:
> SoapUI:
>  Accept-Encoding: gzip,deflate[\r][\n]
>  Content-Type: text/xml;charset=UTF-8[\r][\n]
>  Content-Length: 4[\r][\n]
>  *Host: host-123:8080[\r][\n]*
>  Connection: Keep-Alive[\r][\n]
>  User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]
>
> SAP:
> content-type: text/xml; charset=utf-8\r\n
> content-length: 3391\r\n
> [Content length: 3391]
> connection: keep-alive\r\n
> accept-encoding: gzip, deflate\r\n
> user-agent: SAP NetWeaver Application Server (1.0;731)\r\n
>* host: host-123:8080\r\n*
> sap-language: D\r\n
>
> The camel netty http component checks if a "Host" http header exists(case
> sensitive), SAP sends "host":
> org.apache.camel.component.netty.http.handlers.HttpServerChannelHandler:
>  // must include HOST header as required by HTTP 1.1
> if (!request.headers().names().contains(HttpHeaders.Names.HOST)) {
> HttpResponse response = new DefaultHttpResponse(HTTP_1_1, BAD_REQUEST);
> response.setChunked(false);
> response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
> response.headers().set(Exchange.CONTENT_LENGTH, 0);
> response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
> messageEvent.getChannel().write(response).syncUninterruptibly();
> messageEvent.getChannel().close();
> return;
> }
>
> HttpHeaders can be/have to be case insensitive, see
> http://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive
> or http://www.ietf.org/rfc/rfc2616.txt.
>
> Should I create a ticket for this?
>
> kind regards,
> soilworker
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Netty-Http-HttpHeaders-case-sensitive-tp5763157.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: java.util.zip.ZipException: error in opening zip file

2015-02-25 Thread Gonzalo Vásquez Sáez
Thanks Claus for such a fast answer! 

Regarding Java versions, we'll try to install a Java 7 or 8 in that Linux box, 
but as an alternate approach, which Camel version DOES support Java 6 so we 
could try that approach too?

Atentamente / Regards,

Gonzalo Vásquez Sáez
gvasq...@waypoint.cl
+56 (2) 29634180
Director I+D / R&D Director
Waypoint Telecomunicaciones S.A.

Alfredo Barros Errázuriz 1953 Of. 1004
7500550
Providencia, Santiago, Chile
Mapcode: R3.BR









> El 25-02-2015, a las 11:10, Claus Ibsen  escribió:
> 
> Camel 2.14.x does not support Java 6. You must use Java 7 or 8.
> 
> On Wed, Feb 25, 2015 at 3:02 PM, Gonzalo Vásquez Sáez
>  wrote:
>> Hi everybody,
>> 
>> I’m using Camel 2.14.1, mainly to use a timer and an http consumer 
>> (URL_FLEET_HISTORY), as shown on the following Java code:
>> 
>> @Override
>>public void configure() throws Exception {
>> 
>>from("timer:ws?period=" + period)
>>.process(new Processor() {
>> 
>>@Override
>>public void process(Exchange exchange) throws Exception {
>>Calendar cal = Calendar.getInstance();
>>System.out.println("Searching new data @ "
>>+ cal.getTime());
>>cal.add(Calendar.HOUR, -48);
>>System.out.println("Since " + cal.getTime());
>>String lastReport = LAST_REPORT_DATE_FORMAT.format(cal
>>.getTime());
>>exchange.getOut().setHeader("lastReport", lastReport);
>> 
>>}
>>})
>>.recipientList(
>>simple(URL_FLEET_HISTORY + USERNAME + SLASH + PASSWORD
>>+ SLASH + "${header.lastReport}"))
>>.convertBodyTo(String.class)
>>.log(LoggingLevel.INFO, logger, "Data Received: ${body}")
>>.split().tokenizePair("", "", true)
>>.process(new LocationProcessor());
>>}
>> 
>> I’m also using org.apache.camel.main.Main to run the process as a command 
>> line forever running kind of daemon. with this code:
>> 
>> public class Listener {
>> 
>>public static void main(String[] args) throws Exception {
>>Listener daemon = new Listener();
>>daemon.boot();
>>}
>> 
>>private Main main;
>> 
>>public void boot() throws Exception {
>>// create a Main instance
>>main = new Main();
>>// enable hangup support so you can press ctrl + c to terminate the 
>> JVM
>>main.enableHangupSupport();
>> 
>>// add routes
>>main.addRouteBuilder(new SkyPatrolRouteBuilder());
>> 
>>// run until you terminate the JVM
>>System.out.println("Starting Listener. Use Ctrl + c to terminate.");
>>main.run();
>>}
>> 
>> }
>> 
>> After a few days running the HTTP consumer starts to fail consistently with 
>> the following stacktrace:
>> 
>> 228243785 [Camel (camel-1) thread #0 - timer://ws]  ERROR 
>> org.apache.camel.processor.DefaultErrorHandler - Failed delivery for 
>> (MessageId: ID-Monitor-59190-1424577519856-0-184780 on ExchangeId: 
>> ID-Monitor-59190-1424577519856-0-184781). Exhausted after delivery attempt: 
>> 1 caught: org.apache.camel.CamelExecutionException: Exception occurred 
>> during execution on the exchange: Exchange[Message: [Body is null]]
>> 
>> Message History
>> ---
>> RouteId  ProcessorId  Processor  
>>   Elapsed (ms)
>> [route1] [route1] [timer://ws?period=18  
>> ] [41 
>> ]
>> [route1] [process1  ] 
>> [cl.waypoint.monitor.skypatrol.SkyPatrolRouteBuilder$1@549b6220  
>>   ] [ 1]
>> [route1] [recipientList1] [recipientList[simple{Simple: 
>> http://wsp.skypatrol.com/fleet_history/waypointch] 
>>  [42]
>> 
>> Exchange
>> ---
>> Exchange[
>>Id  ID-Monitor-59190-1424577519856-0-184781
>>ExchangePattern InOnly
>>Headers 
>> {breadcrumbId=ID-Monitor-59190-1424577519856-0-184780, 
>> CamelRedelivered=false, CamelRedeliveryCounter=0, lastReport=20150222162243}
>>BodyTypenull
>>Body[Body is null]
>> ]
>> 
>> Stacktrace
>> ---
>> org.apache.camel.CamelExecutionException:

Re: java.util.zip.ZipException: error in opening zip file

2015-02-25 Thread Claus Ibsen
Camel 2.14.x does not support Java 6. You must use Java 7 or 8.

On Wed, Feb 25, 2015 at 3:02 PM, Gonzalo Vásquez Sáez
 wrote:
> Hi everybody,
>
> I’m using Camel 2.14.1, mainly to use a timer and an http consumer 
> (URL_FLEET_HISTORY), as shown on the following Java code:
>
> @Override
> public void configure() throws Exception {
>
> from("timer:ws?period=" + period)
> .process(new Processor() {
>
> @Override
> public void process(Exchange exchange) throws Exception {
> Calendar cal = Calendar.getInstance();
> System.out.println("Searching new data @ "
> + cal.getTime());
> cal.add(Calendar.HOUR, -48);
> System.out.println("Since " + cal.getTime());
> String lastReport = LAST_REPORT_DATE_FORMAT.format(cal
> .getTime());
> exchange.getOut().setHeader("lastReport", lastReport);
>
> }
> })
> .recipientList(
> simple(URL_FLEET_HISTORY + USERNAME + SLASH + PASSWORD
> + SLASH + "${header.lastReport}"))
> .convertBodyTo(String.class)
> .log(LoggingLevel.INFO, logger, "Data Received: ${body}")
> .split().tokenizePair("", "", true)
> .process(new LocationProcessor());
> }
>
> I’m also using org.apache.camel.main.Main to run the process as a command 
> line forever running kind of daemon. with this code:
>
> public class Listener {
>
> public static void main(String[] args) throws Exception {
> Listener daemon = new Listener();
> daemon.boot();
> }
>
> private Main main;
>
> public void boot() throws Exception {
> // create a Main instance
> main = new Main();
> // enable hangup support so you can press ctrl + c to terminate the 
> JVM
> main.enableHangupSupport();
>
> // add routes
> main.addRouteBuilder(new SkyPatrolRouteBuilder());
>
> // run until you terminate the JVM
> System.out.println("Starting Listener. Use Ctrl + c to terminate.");
> main.run();
> }
>
> }
>
> After a few days running the HTTP consumer starts to fail consistently with 
> the following stacktrace:
>
> 228243785 [Camel (camel-1) thread #0 - timer://ws]  ERROR 
> org.apache.camel.processor.DefaultErrorHandler - Failed delivery for 
> (MessageId: ID-Monitor-59190-1424577519856-0-184780 on ExchangeId: 
> ID-Monitor-59190-1424577519856-0-184781). Exhausted after delivery attempt: 1 
> caught: org.apache.camel.CamelExecutionException: Exception occurred during 
> execution on the exchange: Exchange[Message: [Body is null]]
>
> Message History
> ---
> RouteId  ProcessorId  Processor   
>  Elapsed (ms)
> [route1] [route1] [timer://ws?period=18   
>] [41 
> ]
> [route1] [process1  ] 
> [cl.waypoint.monitor.skypatrol.SkyPatrolRouteBuilder$1@549b6220   
>  ] [ 1]
> [route1] [recipientList1] [recipientList[simple{Simple: 
> http://wsp.skypatrol.com/fleet_history/waypointch] 
>  [42]
>
> Exchange
> ---
> Exchange[
> Id  ID-Monitor-59190-1424577519856-0-184781
> ExchangePattern InOnly
> Headers 
> {breadcrumbId=ID-Monitor-59190-1424577519856-0-184780, 
> CamelRedelivered=false, CamelRedeliveryCounter=0, lastReport=20150222162243}
> BodyTypenull
> Body[Body is null]
> ]
>
> Stacktrace
> ---
> org.apache.camel.CamelExecutionException: Exception occurred during execution 
> on the exchange: Exchange[Message: [Body is null]]
> at 
> org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1380)
> at 
> org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:283)
> at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:64)
> at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)
> at 
> org.apache.camel.processor.CamelInternalProcessor.pro

Re: camel-blueprint.xsd is not updated

2015-02-25 Thread yogu13
anyone?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-blueprint-xsd-is-not-updated-tp5763118p5763156.html
Sent from the Camel - Users mailing list archive at Nabble.com.


java.util.zip.ZipException: error in opening zip file

2015-02-25 Thread Gonzalo Vásquez Sáez
Hi everybody,

I’m using Camel 2.14.1, mainly to use a timer and an http consumer 
(URL_FLEET_HISTORY), as shown on the following Java code:

@Override
public void configure() throws Exception {

from("timer:ws?period=" + period)
.process(new Processor() {

@Override
public void process(Exchange exchange) throws Exception {
Calendar cal = Calendar.getInstance();
System.out.println("Searching new data @ "
+ cal.getTime());
cal.add(Calendar.HOUR, -48);
System.out.println("Since " + cal.getTime());
String lastReport = LAST_REPORT_DATE_FORMAT.format(cal
.getTime());
exchange.getOut().setHeader("lastReport", lastReport);

}
})
.recipientList(
simple(URL_FLEET_HISTORY + USERNAME + SLASH + PASSWORD
+ SLASH + "${header.lastReport}"))
.convertBodyTo(String.class)
.log(LoggingLevel.INFO, logger, "Data Received: ${body}")
.split().tokenizePair("", "", true)
.process(new LocationProcessor());
}

I’m also using org.apache.camel.main.Main to run the process as a command line 
forever running kind of daemon. with this code:

public class Listener {

public static void main(String[] args) throws Exception {
Listener daemon = new Listener();
daemon.boot();
}

private Main main;

public void boot() throws Exception {
// create a Main instance
main = new Main();
// enable hangup support so you can press ctrl + c to terminate the JVM
main.enableHangupSupport();

// add routes
main.addRouteBuilder(new SkyPatrolRouteBuilder());

// run until you terminate the JVM
System.out.println("Starting Listener. Use Ctrl + c to terminate.");
main.run();
}

}

After a few days running the HTTP consumer starts to fail consistently with the 
following stacktrace:

228243785 [Camel (camel-1) thread #0 - timer://ws]  ERROR 
org.apache.camel.processor.DefaultErrorHandler - Failed delivery for 
(MessageId: ID-Monitor-59190-1424577519856-0-184780 on ExchangeId: 
ID-Monitor-59190-1424577519856-0-184781). Exhausted after delivery attempt: 1 
caught: org.apache.camel.CamelExecutionException: Exception occurred during 
execution on the exchange: Exchange[Message: [Body is null]]

Message History
---
RouteId  ProcessorId  Processor 
   Elapsed (ms)
[route1] [route1] [timer://ws?period=18             
                                         ] [        41 
]
[route1] [process1  ] 
[cl.waypoint.monitor.skypatrol.SkyPatrolRouteBuilder$1@549b6220
] [ 1]
[route1] [recipientList1] [recipientList[simple{Simple: 
http://wsp.skypatrol.com/fleet_history/waypointch] 
 [42]

Exchange
---
Exchange[
Id  ID-Monitor-59190-1424577519856-0-184781
ExchangePattern InOnly
Headers 
{breadcrumbId=ID-Monitor-59190-1424577519856-0-184780, CamelRedelivered=false, 
CamelRedeliveryCounter=0, lastReport=20150222162243}
BodyTypenull
Body[Body is null]
]

Stacktrace
---
org.apache.camel.CamelExecutionException: Exception occurred during execution 
on the exchange: Exchange[Message: [Body is null]]
at 
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1380)
at 
org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:283)
at 
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:64)
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at 
org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:586)
at 
org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:514)
at 
org.apache.camel.processor.MulticastProcessor.process(Multicas

Camel Netty Http: HttpHeaders case sensitive

2015-02-25 Thread cgiera
Hello,

we are implementing a http camel route for receiving data from SAP.
The route consumes from a netty-http endpoint(from("netty-http...")).

Our tests with SoapUi worked fine, but when we tried sending data from the
SAP system the test failed with http 400 bad request.
After some research I found https://issues.apache.org/jira/browse/CAMEL-6599
where is mentioned to check if the host appears as http header.

I analyzed the http requests:
SoapUI:
 Accept-Encoding: gzip,deflate[\r][\n]
 Content-Type: text/xml;charset=UTF-8[\r][\n]
 Content-Length: 4[\r][\n]
 *Host: host-123:8080[\r][\n]*
 Connection: Keep-Alive[\r][\n]
 User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]

SAP:
content-type: text/xml; charset=utf-8\r\n
content-length: 3391\r\n
[Content length: 3391]
connection: keep-alive\r\n
accept-encoding: gzip, deflate\r\n
user-agent: SAP NetWeaver Application Server (1.0;731)\r\n
   * host: host-123:8080\r\n*
sap-language: D\r\n

The camel netty http component checks if a "Host" http header exists(case
sensitive), SAP sends "host":
org.apache.camel.component.netty.http.handlers.HttpServerChannelHandler: 
 // must include HOST header as required by HTTP 1.1
if (!request.headers().names().contains(HttpHeaders.Names.HOST)) {
HttpResponse response = new DefaultHttpResponse(HTTP_1_1, BAD_REQUEST);
response.setChunked(false);
response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
response.headers().set(Exchange.CONTENT_LENGTH, 0);
response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
messageEvent.getChannel().write(response).syncUninterruptibly();
messageEvent.getChannel().close();
return;
}

HttpHeaders can be/have to be case insensitive, see
http://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive
or http://www.ietf.org/rfc/rfc2616.txt.

Should I create a ticket for this?

kind regards,
soilworker



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Netty-Http-HttpHeaders-case-sensitive-tp5763157.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Upgrading to Camel 2.14.1 and CompositeRegistry issue

2015-02-25 Thread geppo
Hi, I'm trying to upgrade some legacy code to use Camel 2.14.1, but I'm
getting an AbstractMethodError when the method lookupByNameAndType is
called. Any idea what this means and/or how I can fix it?
Many thanks!

Caused by: org.apache.camel.NoSuchBeanException: Cannot lookup: properties
from registry: myUtils.camel.guice.GuiceRegistry@2ba95c45 with expected
type: class org.apache.camel.component.properties.PropertiesComponent due:
null
at
org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:62)
at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByNameAndType(PropertyPlaceholderDelegateRegistry.java:63)
at
org.apache.camel.util.CamelContextHelper.lookupPropertiesComponent(CamelContextHelper.java:492)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1891)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1767)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1735)
at myUtils.camel.MyService.start(MyService.java:19)
... 5 more
Caused by: java.lang.AbstractMethodError
at
org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:56)
... 12 more




--
View this message in context: 
http://camel.465427.n5.nabble.com/Upgrading-to-Camel-2-14-1-and-CompositeRegistry-issue-tp5763152.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Failover with Camel CXF

2015-02-25 Thread sayed_india
Hi,
I followed the instructions provided but unable to implement shows the
error:
[LoadBalanceType[ref:null... because of ref or loadBalancer must be
specified.

Please find below code snippet and correct me where I go wrong with this.

WSDL
--
 
  


  http://localhost:9000/order"; />


  http://localhost:9001/order"; />


  http://localhost:9002/order"; />


  
--
Endpoint config:

http://localhost:9000/order/";
serviceClass="camelinaction.order.OrderEndpoint"
wsdlURL="wsdl/order.wsdl">

http://localhost:9001/order/";
serviceClass="camelinaction.order.OrderEndpoint"
wsdlURL="wsdl/order.wsdl">

http://localhost:9002/order/";
serviceClass="camelinaction.order.OrderEndpoint"
wsdlURL="wsdl/order.wsdl">


Camel Route:




  
 

 



OK



Appreciate a quick response.

Thanks and Regards,
Sayed




--
View this message in context: 
http://camel.465427.n5.nabble.com/Failover-with-Camel-CXF-tp5723454p5763151.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Rest DSL with Jetty and multipart/form-data POST

2015-02-25 Thread francesco.boscarino
Hi, I'm trying to POST a file, along with some parameters, towards a RestDSL
endpoint:



  

  



  
  


But I can get only "id" in headers, and not the ones inside the multipart
and I have no attachments with posted file. It seems like the rest endpoint
does not enable multipart filter which I enabled on jetty component with no
success.

Any idea on how to achieve this?

Francesco



--
View this message in context: 
http://camel.465427.n5.nabble.com/Rest-DSL-with-Jetty-and-multipart-form-data-POST-tp5763150.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SFTP file process order

2015-02-25 Thread Dewitte P-Alban
Hi,

I think sorter and sortBy are the options you are looking for.
http://camel.apache.org/file2.html

Best regards
Pierre-Alban

Le Tue Feb 24 2015 at 20:38:23, shreyas  a
écrit :

> Hello,
>
> Is anyone aware of default file process order in SFTP component? I am
> downloading files from SFTP server to local disk using readchange strategy.
> What happens if multiple files are put in the SFTP server. Are they
> processed in datetime order or some other order. I did look into file2
> consumer but did not read anything about process order.
>
> Also, is SFTP download's concurrent? I know FTP is not, but what about
> SFTP.
>
> Thanks in advance,
> Shreyas Purohit


Re: IBM MQ Issue because of Spring JMS Listener

2015-02-25 Thread Gnana
I have used *inOnly* instead of to in route. it is working fine. to is
getting response and camel is trying to update response in default
queue.default queue doesn't have access. so I am getting warning.  now
inOnly won't expect response.



--
View this message in context: 
http://camel.465427.n5.nabble.com/IBM-MQ-Issue-because-of-Spring-JMS-Listener-tp5762991p5763140.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel blueprint support multiple mail boxes ???

2015-02-25 Thread yogu13
Hello Gary,

>From what i understand about your problem creating / configuring dynamic
routes using RouteBuilder (Java DSL) should simplfy things for you, Assuming
that you list of mailboxes is only configured in the configuration file can
vary over a period of time.

example @
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/AddRoutesAtRuntimeTest.java

Hope this helps!

Regards,
-Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126p5763141.html
Sent from the Camel - Users mailing list archive at Nabble.com.