Re: Customize the Http Response Code for REST Service

2016-03-25 Thread fabrizio.spataro
Hello,

I had same problem and i resolve it using "onException tag" to intercept
validation error and return another http response code

Example DSL:


  
java.your.exception

403

 true
   
.







--
View this message in context: 
http://camel.465427.n5.nabble.com/Customize-the-Http-Response-Code-for-REST-Service-tp5779682p5779691.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue with dynamic uri

2016-03-25 Thread fabrizio.spataro
Hello,

abstractly dynamic uri can be do it using recipientList + simple leanguage

example here: http://camel.apache.org/recipient-list.html







--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-maven-plugin executable jar, MANIFEST entry is missing

2016-03-24 Thread fabrizio.spataro
ok

when 2.16.3 is released? :-)



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-maven-plugin-executable-jar-MANIFEST-entry-is-missing-tp5779625p5779663.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-maven-plugin executable jar, MANIFEST entry is missing

2016-03-24 Thread fabrizio.spataro
Yes!!!

I am using pom same pom.xml with all camel dependencies for my project!!!...

If i change camel version from 2.16.2 to 2.16.3-SNAPSHOT maven jar plugin
failure!





--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-maven-plugin-executable-jar-MANIFEST-entry-is-missing-tp5779625p5779656.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-maven-plugin executable jar, MANIFEST entry is missing

2016-03-24 Thread fabrizio.spataro
Hello Claus,

I cannot insert camel-spring manually because it is a maven plugin work!

I repeat this concept: with camel 2.16.2 it is all ok!!! Is it a bug of
2.16.3 version?

According follow source code, maven jar plugin is able to do it:


org.apache.maven.plugins
maven-jar-plugin
2.6



true
com..SpringMain
lib/



   */**/*.class







--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-maven-plugin-executable-jar-MANIFEST-entry-is-missing-tp5779625p5779654.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-maven-plugin executable jar, MANIFEST entry is missing

2016-03-24 Thread fabrizio.spataro
Hello,

i am using camel-maven-plugin with camel version 2.16.3-SNAPSHOT, but my
executable jar don't have enough MANIFEST 's entries (for example
camel-spring is missing!!)

With camel 2.16.2 it is all ok!

It's a bug?

Output:

$ java -jar myFantasticCamelApplication.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/camel/spring/Main
at com.x.SpringMain.boot(SpringMain.java:25)
at com.x.SpringMain.main(SpringMain.java:19)
Caused by: java.lang.ClassNotFoundException: org.apache.camel.spring.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 2 more




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-maven-plugin-executable-jar-MANIFEST-entry-is-missing-tp5779625.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Limit of Error handling in Camel

2016-03-15 Thread fabrizio.spataro
Hello,

i have a modular apache camel project (camel 2.15.5), with multiple camel
context xml file.

My project package's steps are:

Step 1. 

maven copy *.xml camel context into a common directory META-INF/spring

Step 2.

maven camel:run

Step 3.

Into main camel-context i am declaring all reference according to
camelContextRef tag

Step 4. 

Into main camel-context i put all onException tag

Now i would change this structure and put all onException tags into a
separated file. But cannot do it (XSD Error)!!!

This is my *wrong* code









Can i put error handling out of main camelContext xml file? 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Limit-of-Error-handling-in-Camel-tp5779105.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-swagger-java not parse property

2016-03-14 Thread fabrizio.spataro
Hello,

The jira is resolved end I am using camel-2.16.3-SNAPSHOT but i'm still same
bug

Is it ok?

what am I doing wrong?




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-swagger-java-not-parse-property-tp5778734p5779008.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-swagger-java not parse property

2016-03-09 Thread fabrizio.spataro
+1



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-swagger-java-not-parse-property-tp5778734p5778805.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Limit swagger API

2016-03-09 Thread fabrizio.spataro




--
View this message in context: 
http://camel.465427.n5.nabble.com/Limit-swagger-API-tp5778791p5778804.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Limit swagger API

2016-03-09 Thread fabrizio.spataro
Hello,

To hide part of my API documentation, It could be nice to have a swagger
switch off mode.

I am thinking the following code:


off

   
   
   



Best regards



--
View this message in context: 
http://camel.465427.n5.nabble.com/Limit-swagger-API-tp5778791.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-swagger-java not parse property

2016-03-08 Thread fabrizio.spataro
Hello.

There is a bug into swagger JSON file.

I am using follow rest DSL (xml) with camel-2.16.3-SNAPSHOT


   ...


Output Swagger JSON:

{
  "swagger" : "2.0",
  "info" : {
"version" : "1.0.0",
"title" : "MY API"
  },
  "host" : "0.0.0.0:8080",
  "tags" : [ {
"name" : "{{rest.root.path}}"
  } ],
  "schemes" : [ "http" ],
  "paths" : {
"{{rest.root.path}}/users" : {
  "get" : {
"tags" : [ "{{rest.root.path}}" ],
"produces" : [ "application/json" ],
...

.




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-swagger-java-not-parse-property-tp5778734.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-sql Query with params list

2016-03-04 Thread fabrizio.spataro
I expected your answer.

Claus give me some clues. I try to develop it, and then I'll send



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-sql-Query-with-params-list-tp5778544p5778582.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-sql Query with params list

2016-03-03 Thread fabrizio.spataro
hello,

i would execute this query:



But i am thinking it is not supported yet.

How to do it?

Tnkx, fabrizio



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-sql-Query-with-params-list-tp5778544.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Splitting within transactions

2015-11-19 Thread fabrizio.spataro
Hello. I have a similar problem.

How to resolve it?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Splitting-within-transactions-tp5719539p5774114.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel 2.16 vs Jetty9 vs camel-websocket

2015-11-10 Thread fabrizio.spataro
Hello,

i would use camel 2.16 + jetty9 + camel-websocket but this component depends
from jetty8.

How can i do?

i am trying force to use jetty9 from maven without success.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-16-vs-Jetty9-vs-camel-websocket-tp5773575.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Upgrade to 2.16.0

2015-10-13 Thread fabrizio.spataro
Hello. 

This is a big problem because my project contains more than 100 routes.






--
View this message in context: 
http://camel.465427.n5.nabble.com/Upgrade-to-2-16-0-tp5772570p5772597.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Interceptor into external file

2015-09-10 Thread fabrizio.spataro
Ok thanks, my (temporary?) implementation is:

FILE 1:



 ... MY CODE .. 
 ... MY CODE .. 
 ... MY CODE .. 
 ... MY CODE .. 




MAIN FILE:

http://camel.apache.org/schema/spring";
errorHandlerRef="deadLetterErrorHandler">

**
 ... ANOTHER CODE .. 
 ... ANOTHER CODE .. 





 ... ANOTHER CODE .. 
 ... ANOTHER CODE .. 
 ... ANOTHER CODE .. 





--
View this message in context: 
http://camel.465427.n5.nabble.com/Interceptor-into-external-file-tp5771400p5771410.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Interceptor into external file

2015-09-10 Thread fabrizio.spataro
Camel interceptor:

http://camel.apache.org/schema/spring";
errorHandlerRef="deadLetterErrorHandler">
 ... ANOTHER CODE ..
 ... ANOTHER CODE ..
 ... ANOTHER CODE ..


 ... MY CODE ..
 ... MY CODE ..
 ... MY CODE ..
 ... MY CODE ..


 ... ANOTHER CODE ..
 ... ANOTHER CODE ..
 ... ANOTHER CODE ..





--
View this message in context: 
http://camel.465427.n5.nabble.com/Interceptor-into-external-file-tp5771400p5771403.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Interceptor into external file

2015-09-10 Thread fabrizio.spataro
Hello,

i would use same interceptor (XML Spring implementation) into my different
projects.

Can i reference an interceptor like "routeContextRef" tag or
"restContextRef" tag?







--
View this message in context: 
http://camel.465427.n5.nabble.com/Interceptor-into-external-file-tp5771400.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Local XSD Schema into CamelContext File

2015-05-22 Thread fabrizio.spataro
Hello everyone,

In my camel-context file i would use a local XSD schema.

Today my camel-context start with:

http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:camel="http://camel.apache.org/schema/spring";
   xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring-2.14.1.xsd";>

I tried to copy XSD files into follow folders but i don't have success:

 - Into META-INF
 - Into META-INF/spring
 - Into project root
.

Can you help me?

Note: i am using camel with a standalone JAR

Best Regards



--
View this message in context: 
http://camel.465427.n5.nabble.com/Local-XSD-Schema-into-CamelContext-File-tp5767414.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [SQL Component] Transaction manager force commit

2015-02-26 Thread fabrizio.spataro
Hello everyone,

To force commit you just typing ** 

King Regards!



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-Component-Transaction-manager-force-commit-tp5762948p5763193.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[SQL Component] Transaction manager force commit

2015-02-19 Thread fabrizio.spataro
Hello,

i am using camel 2.14.2-SNAPSHOT.

Into my transacted route are using this settings:


  







My routes are:












Can i insert a *programmatic commit* between QUERY 2 and QUERY 3? How do it
with SPRING DSL?

thankx



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-Component-Transaction-manager-force-commit-tp5762948.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Javascript DSL, "response" is not defined

2015-02-17 Thread fabrizio.spataro
So,

I am using the code according to this page (
http://camel.apache.org/javascript.html )



--
View this message in context: 
http://camel.465427.n5.nabble.com/Javascript-DSL-response-is-not-defined-tp5762839p5762844.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Javascript DSL, "response" is not defined

2015-02-17 Thread fabrizio.spataro
Hello everyone.

I am using camel 2.14.2-SNAPSHOT and i am trying to access object *response*
into my code:

Can you help me? 

Spring DSL:


 
var a = request;  // OK
var b = request.body;  // OK
var c = response;  //FAIL
 


Stacktrace:
Caused by: sun.org.mozilla.javascript.EcmaError: ReferenceError: "response"
is not defined. (#8)
at
sun.org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3785)
at
sun.org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3763)
at
sun.org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3848)
at 
sun.org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1781)




--
View this message in context: 
http://camel.465427.n5.nabble.com/Javascript-DSL-response-is-not-defined-tp5762839.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [Camel SQL] CamelSqlRetrieveGeneratedKeys attribute delete all headers

2015-02-10 Thread fabrizio.spataro
Thanks to resolve the issue: https://issues.apache.org/jira/browse/CAMEL-8329

I am testing now!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-SQL-CamelSqlRetrieveGeneratedKeys-attribute-delete-all-headers-tp5762512p5762544.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [Camel SQL] CamelSqlRetrieveGeneratedKeys attribute delete all headers

2015-02-10 Thread fabrizio.spataro
Hello, i am using batch value. This seems to work but i lost transactional
functionality.

So.. i am creating the issue into JIRA

My settings are:

 







false
false
false




  




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-SQL-CamelSqlRetrieveGeneratedKeys-attribute-delete-all-headers-tp5762512p5762532.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[Camel SQL] CamelSqlRetrieveGeneratedKeys attribute delete all headers

2015-02-09 Thread fabrizio.spataro
Hello everyone,

I am using Camel (2.14.1) SQL component, with
*CamelSqlRetrieveGeneratedKeys=true*.

After an insert operation i have a correct CamelSqlGeneratedKeyRows value
but *I am lost all my previous header params.*

Is it a bug?

There is any param to preserve my headers?

Tnkx



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-SQL-CamelSqlRetrieveGeneratedKeys-attribute-delete-all-headers-tp5762512.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[Jetty] Change request header size to jetty http component

2015-02-02 Thread fabrizio.spataro
Hello everyone,

How to change request header size default values on jetty http component?

i am trying follow code without success.

Can you help me? 

thanks








--
View this message in context: 
http://camel.465427.n5.nabble.com/Jetty-Change-request-header-size-to-jetty-http-component-tp5762312.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [Jetty] Change request header size to jetty http component

2015-02-02 Thread fabrizio.spataro
I am using camel 2.14.1 and Rest DSL



--
View this message in context: 
http://camel.465427.n5.nabble.com/Jetty-Change-request-header-size-to-jetty-http-component-tp5762312p5762313.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [SQL COMPONENTE] CamelSqlGeneratedKeyRows has a bug?

2015-01-09 Thread fabrizio.spataro
Thanks guy!

I finally solved my problem

King regards!



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-COMPONENT-CamelSqlGeneratedKeyRows-has-a-bug-tp5761113p5761529.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [SQL COMPONENTE] CamelSqlGeneratedKeyRows has a bug?

2015-01-09 Thread fabrizio.spataro
Of course! I never want to use out message but reading example code (posted
by Grzegorz Grzybek) i suppose that *CamelSqlGeneratedKeyRows * variable set
into it.

code:

// assertions of the response
assertNotNull(out);
assertNotNull(out.getOut());
assertNotNull(out.getOut().getHeader(SqlConstants.SQL_GENERATED_KEYS_DATA));

(source:
https://github.com/apache/camel/blob/camel-2.14.1/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlGeneratedKeysTest.java#L70-L97)

This variable is not present even into "in message" headers.

My attach code test what I'm saying. Can you run it?

Thnkx everyone!



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-COMPONENT-CamelSqlGeneratedKeyRows-has-a-bug-tp5761113p5761506.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [SQL COMPONENT] mysql transaction

2015-01-08 Thread fabrizio.spataro
Hello,

using spring DSL and tag  i have this error:

*org.apache.camel.NoSuchBeanException: No bean could be found in the
registry of type: PlatformTransactionManager*

So.. i don't have any transactionManager. My connection is a simple mysql
connection like:



 ...
 ... 


can you help me?



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-COMPONENT-mysql-transaction-tp576p5761462.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [SQL COMPONENTE] CamelSqlGeneratedKeyRows has a bug?

2015-01-08 Thread fabrizio.spataro
Hello,

So.. is it a bug? I haven't any information about generated keys (OUT
Message is null)

this is my code:



http://camel.apache.org/schema/spring";>

  
 

   
true
   



insert into company (id, name, 
description, email) values (0,
'myName', '', 'he...@camel.com')








${out.header.CamelSqlGeneratedKeyRows}

  
 


  

I had attach full example code package RetrieveGeneratedKey.zip
  



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-COMPONENT-CamelSqlGeneratedKeyRows-has-a-bug-tp5761113p5761460.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [SQL COMPONENTE] CamelSqlGeneratedKeyRows has a bug?

2015-01-07 Thread fabrizio.spataro
My camel version is 2.14.1



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-COMPONENT-CamelSqlGeneratedKeyRows-has-a-bug-tp5761113p5761430.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[SQL COMPONENTE] CamelSqlGeneratedKeyRows has a bug?

2014-12-29 Thread fabrizio.spataro
Hello,

i am using sql component with CamelSqlRetrieveGeneratedKeys=true but after
an insert operation i don't have any CamelSqlGeneratedKeyRows header.

Is it a bug?

I am using mysql server 5.1.

Tnkx



--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-COMPONENTE-CamelSqlGeneratedKeyRows-has-a-bug-tp5761113.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[SQL COMPONENT] mysql transaction

2014-12-29 Thread fabrizio.spataro
Hello,

i would use sql component (http://camel.apache.org/sql-component.html) into
a transactional scenario.

For example:

0) begin
1) insert
2) insert
3) commit

I am using mysql. 

What is the best strategy to do it using camel's component?

Tnkx





--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-COMPONENT-mysql-transaction-tp576.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Testing REST Service

2014-12-16 Thread fabrizio.spataro
Sure... i can use any rest tool but my idea is create a set of regression
test to help me on the future. 

ps. i am moving  to maven central. Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Testing-REST-Service-tp5760757p5760764.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Testing REST Service

2014-12-16 Thread fabrizio.spataro
Hello,

i am using camel 2.14.1 (snapshot) to aim use newest camel rest component
(using REST DSL).

I am writing more rest services and i would test it using camel test java
class.

My main idea is write java class extends CamelTestSupport and use http camel
component to invoke my REST services.

Is it possible? 

There is another best testing strategy?

Thanks

FabryProg

http://www.fabryprog.it



--
View this message in context: 
http://camel.465427.n5.nabble.com/Testing-REST-Service-tp5760757.html
Sent from the Camel - Users mailing list archive at Nabble.com.