Re: camel xmljson add @ signs to the json output. how to remove the @ signs

2014-11-12 Thread Claus Ibsen
Hi

What version of Camel do you use? And have you configured the xmljson
data format in any way?

The @ is because the xml value is from an xml attribute. I wonder if
there is a way to turn that off in the xmljson library as yeah that is
not needed in the json output.


On Thu, Nov 13, 2014 at 12:27 AM, salemi  wrote:
> Hi,
>
> I am using the xmljson to convert xml to json. When I do that then I see @
> signs added to attributes of an element see example below. How can I remove
> the @ signs from the output.
>
> xml file:
>  
> 
>   
> 
> US
> 
>   
>   
>   
>   
>   
> 
> 
>   
>   
>   
>   
>   
>   
> 
>
> JSON output:
> {
> "city": {
> "@id": "5095626",
> "@name": "Bernardsville",
> "coord": {
> "@lon": "-74.57",
> "@lat": "40.68"
> },
> "country": "US",
> "sun": {
> "@rise": "2014-11-12T11:42:13",
> "@set": "2014-11-12T21:42:48"
> }
> },
> "temperature": {
> "@value": "286.59",
> "@min": "284.95",
> "@max": "288.15",
> "@unit": "kelvin"
> },
> "humidity": {
> "@value": "68",
> "@unit": "%"
> },
> "pressure": {
> "@value": "1006.973",
> "@unit": "hPa"
> },
> "wind": {
> "speed": {
> "@value": "2.66",
> "@name": "Light breeze"
> },
> "direction": {
> "@value": "326",
> "@code": "NW",
> "@name": "Northwest"
> }
> },
> "clouds": {
> "@value": "0",
> "@name": "clear sky"
> },
> "visibility": [],
> "precipitation": {
> "@mode": "no"
> },
> "weather": {
> "@number": "800",
> "@value": "Sky is Clear",
> "@icon": "01n"
> },
> "lastupdate": {
> "@value": "2014-11-12T23:06:51"
> }
> }
>
>
>
>
> -
> Alireza Salemi
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013.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-metrics Question

2014-11-12 Thread Claus Ibsen
Hi

See this FAQ
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

On Thu, Nov 13, 2014 at 5:19 AM, James L Greene  wrote:
> Just out of curiosity, is there a particular design reason that you can't use 
> variable substitution/dynamic expressions in the defintion of URI's for the 
> camel-metrics component?
>
> Consider the following example.  I'm reading files from a source directory, 
> and want to keep track of the number of records contained in each file.  To 
> pull this off, I need to set header values to override the metric name:
>
> from("file://source").
>to("metrics:counter:source.document.count").
>split(body().tokenize("\r\n|\n").
>to("direct:process");
>
> from("direct:process").
>setHeater(MetricsConstants.HEADER_METRIC_NAME, 
> simple("source[${header.CamelFileName}].count")).
>to("metrics:counter:source[].count").
>...
>
> If you have a fairly complicated integration route with several metrics to 
> track, this really clutters up the route.  It would be much more desireable 
> to do variable substitution in the URI itself, like this:
>
> from("direct:process").
>to("metrics:counter:source[${header.CamelFileName}].count").
>...
>
> I'm just curious as to whether a future rev of the component might be able to 
> eliminate the use of Headers to override the name portion of the URI.  From a 
> design perspective, would moving the metric name to a parameter make this any 
> easier to accomplish?  For example:
>
> from("direct:process").
>to("metrics:counter?name=source[${header.CamelFileName}].count").
>...
>
> Either way, this component is really helping out with a requirement for my 
> current project!



-- 
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/


camel xmljson add @ signs to the json output. how to remove the @ signs

2014-11-12 Thread salemi
Hi,

I am using the xmljson to convert xml to json. When I do that then I see @
signs added to attributes of an element see example below. How can I remove
the @ signs from the output.

xml file:
 

  

US

  
  
  
  
  


  
  
  
  
  
  


JSON output:
{
"city": {
"@id": "5095626",
"@name": "Bernardsville",
"coord": {
"@lon": "-74.57",
"@lat": "40.68"
},
"country": "US",
"sun": {
"@rise": "2014-11-12T11:42:13",
"@set": "2014-11-12T21:42:48"
}
},
"temperature": {
"@value": "286.59",
"@min": "284.95",
"@max": "288.15",
"@unit": "kelvin"
},
"humidity": {
"@value": "68",
"@unit": "%"
},
"pressure": {
"@value": "1006.973",
"@unit": "hPa"
},
"wind": {
"speed": {
"@value": "2.66",
"@name": "Light breeze"
},
"direction": {
"@value": "326",
"@code": "NW",
"@name": "Northwest"
}
},
"clouds": {
"@value": "0",
"@name": "clear sky"
},
"visibility": [],
"precipitation": {
"@mode": "no"
},
"weather": {
"@number": "800",
"@value": "Sky is Clear",
"@icon": "01n"
},
"lastupdate": {
"@value": "2014-11-12T23:06:51"
}
}




-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Template solution for JSON

2014-11-12 Thread salemi
I am using Jolt for now. I was hoping there is a better mapping framework out
there. I looked at smooks but it seems to be old.



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Template-solution-for-JSON2JSON-tp5758858p5759014.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-metrics Question

2014-11-12 Thread James L Greene
Just out of curiosity, is there a particular design reason that you can't use 
variable substitution/dynamic expressions in the defintion of URI's for the 
camel-metrics component? 

Consider the following example.  I'm reading files from a source directory, and 
want to keep track of the number of records contained in each file.  To pull 
this off, I need to set header values to override the metric name:

from("file://source").
   to("metrics:counter:source.document.count").
   split(body().tokenize("\r\n|\n").
   to("direct:process");

from("direct:process").
   setHeater(MetricsConstants.HEADER_METRIC_NAME, 
simple("source[${header.CamelFileName}].count")).
   to("metrics:counter:source[].count").
   ...

If you have a fairly complicated integration route with several metrics to 
track, this really clutters up the route.  It would be much more desireable to 
do variable substitution in the URI itself, like this:

from("direct:process").
   to("metrics:counter:source[${header.CamelFileName}].count").
   ...

I'm just curious as to whether a future rev of the component might be able to 
eliminate the use of Headers to override the name portion of the URI.  From a 
design perspective, would moving the metric name to a parameter make this any 
easier to accomplish?  For example:

from("direct:process").
   to("metrics:counter?name=source[${header.CamelFileName}].count").
   ...

Either way, this component is really helping out with a requirement for my 
current project!


Re: Problem with REST DSL (2.14.0) and String bean

2014-11-12 Thread Taariq Levack
Took another squizz at the tree and there's also a 2.1 version of jaxb in
camel-cxf, try exclude that too and let us know.

On Wed, Nov 12, 2014 at 7:19 PM, Taariq Levack  wrote:

> Hi
> Looks like camel-Jackson and camel-jaxb have different jaxb-api versions,
> 2.2 and 2.2.7
> Try excluding jaxb-api from one of them.
>
> Taariq
>
> > On 12 Nov 2014, at 10:52, Vaïsse-Lesteven Arthur 
> wrote:
> >
> > Hi Claus,
> >
> > Firstly, thank for your answer.
> >
> > I currently use Maven to manage dependencies, and I do not specify
> different
> > versions of Apache Camel nor in the POM nor in the dependency tree. As
> you
> > suggested it, I double checked it again. But, because human beings are
> > fallible, I link you the maven dependencies and the related dependencies
> > tree in case there exist some not obvious ignored requirements such as
> > activemq version must be 5.10.0 with camel 2.14.0.
> >
> > I hope this help you to state whether or not the error is due to a
> version
> > conflict. For now, I don't see any version conflict.
> >
> > Here is the dependencies of my project (I provide links to avoid a very
> long
> > post on the mailing list)
> > pom.xml that specify dependencies :
> http://arthurvaisse.free.fr/work/pom.xml
> > text file containing the dependency tree :
> > http://arthurvaisse.free.fr/work/dependencies_tree.txt
> >
> >
> > Vaisse-Lesteven Arthur
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Problem-with-REST-DSL-2-14-0-and-String-bean-tp5758812p5758965.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Multipart form data and servlet/restlet endpoint

2014-11-12 Thread navaltiger
Any pointer towards how to apply such filter?

On Thu, Nov 13, 2014 at 9:30 AM, Willem.Jiang [via Camel] <
ml-node+s465427n5759023...@n5.nabble.com> wrote:

> We apply the multipart handler to jetty endpoint by default.
> If you use camel-servlet, it’s your job to setup that kind of filter in
> the web.xml to parser the Multipart form data for you.
>
> --
> 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 November 12, 2014 at 6:35:59 PM, navaltiger ([hidden email]
> ) wrote:
>
> > Hi,
> >
> > With Jetty based consumer it worked but no luck with servlet. I am
> > executing this package as jetty:run
> >
> > public void configure() throws Exception {
> > // getContext().getProperties().put("CamelJettyTempDir", "target");
> >
> > // Jetty://http works file
> > // from("jetty://http://0.0.0.0:9090/test";).process(new Processor() {
> > .// servlet:// does not work
> > from("servlet:///test").process(new Processor() {
> > public void process(Exchange exchange) throws Exception {
> >
> > Message in = exchange.getIn();
> > StringBuffer v = new StringBuffer();
> >
> > v.append("\n" + in.getAttachmentNames().size() + "\n");
> >
> > Set names = in.getAttachmentNames();
> > for (String n : names) {
> > DataHandler h = in.getAttachment(n);
> > v.append("\n" + h + "\n");
> > if (h != null) {
> > try {
> > int read = 0;
> > byte[] bytes = new byte[1024];
> > // Object o = h.getContent();
> > InputStream inputStream = h.getInputStream();
> > FileOutputStream fout = new FileOutputStream(
> > new File(
> > "/Users/navaltiger/workspace/vr.bin"));
> >
> > while ((read = inputStream.read(bytes)) != -1) {
> > fout.write(bytes, 0, read);
> > }
> > v.append("\n done \n");
> > } catch (Exception e) {
> > e.printStackTrace();
> > }
> > }
> > }
> > exchange.getOut().setBody(v);
> > }
> >
> > });
> > }
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5758976.html
>
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5759023.html
>  To unsubscribe from Multipart form data and servlet/restlet endpoint, click
> here
> 
> .
> NAML
> 
>



-- 

*Vijay Rathi | T: +91 93734 33545 | vijay.ra...@gmail.com
 | *http://gadgetnfun.blogspot.com/




--
View this message in context: 
http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5759024.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Multipart form data and servlet/restlet endpoint

2014-11-12 Thread Willem Jiang
We apply the multipart handler to jetty endpoint by default.
If you use camel-servlet, it’s your job to setup that kind of filter in the 
web.xml to parser the Multipart form data for you.

--  
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 November 12, 2014 at 6:35:59 PM, navaltiger (vijay.ra...@gmail.com) wrote:
> Hi,
>  
> With Jetty based consumer it worked but no luck with servlet. I am
> executing this package as jetty:run
>  
> public void configure() throws Exception {
> // getContext().getProperties().put("CamelJettyTempDir", "target");
>  
> // Jetty://http works file
> // from("jetty://http://0.0.0.0:9090/test";).process(new Processor() {
> .// servlet:// does not work
> from("servlet:///test").process(new Processor() {
> public void process(Exchange exchange) throws Exception {
>  
> Message in = exchange.getIn();
> StringBuffer v = new StringBuffer();
>  
> v.append("\n" + in.getAttachmentNames().size() + "\n");
>  
> Set names = in.getAttachmentNames();
> for (String n : names) {
> DataHandler h = in.getAttachment(n);
> v.append("\n" + h + "\n");
> if (h != null) {
> try {
> int read = 0;
> byte[] bytes = new byte[1024];
> // Object o = h.getContent();
> InputStream inputStream = h.getInputStream();
> FileOutputStream fout = new FileOutputStream(
> new File(
> "/Users/navaltiger/workspace/vr.bin"));
>  
> while ((read = inputStream.read(bytes)) != -1) {
> fout.write(bytes, 0, read);
> }
> v.append("\n done \n");
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> exchange.getOut().setBody(v);
> }
>  
> });
> }
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5758976.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: camel-jetty and Access-Control-Allow-Origin header

2014-11-12 Thread Willem Jiang
You can add the header into message header when you want to send it back.

--  
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 November 12, 2014 at 1:56:39 PM, vvsh (vvs...@gmail.com) wrote:
> Hello.
>  
> Can you help me, how to specify this header for any response?
>  
> Thanks in advance.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-jetty-and-Access-Control-Allow-Origin-header-tp5758942.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Error while deploying camel proxy in tomcat

2014-11-12 Thread Willem Jiang
It look the jetty server doesn’t shutdown rightly.
You may need to check the code of camel-config.xml deployer to see if it 
shutdown the camel context rightly.

--  
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 November 12, 2014 at 7:55:01 PM, Royamit (amitroy...@gmail.com) wrote:
> Hi,
>  
> I have created a proxy webservice which i have hosted on tomcat.
> Also i am monitoring the camel-config.xml for any changes.
> If there is any change in camel-config.xml, tomcat tries to redeploy the
> proxy service war.
> But while redploying i get the following error : -
>  
> org.apache.camel.RuntimeCamelException: org.apache.cxf.interceptor.Fault:  
> Could not add cxf jetty handler for url http:/
> /localhost:9080/camel-example-cxf-proxy/webservices/versionProxy to Jetty  
> server, as the path /camel-example-cxf-proxy/
> webservices/versionProxy is still in use.
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
>   
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)
>   
> at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
>   
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMult
>   
> icaster.java:96)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:3
>   
> 34)
> at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:
>   
> 948)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
>   
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java
>   
> :139)
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java
>   
> :93)
> at
> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:217)  
> at org.apache.camel.spring.Main.doStart(Main.java:157)
> at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at org.apache.camel.example.cxf.proxy.MyMain.init(MyMain.java:32)
> at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
>   
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
>   
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)  
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
>   
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
>   
> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.StandardContext.reload(StandardContext.java:3920)  
> at
> org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1357)  
> at
> org.apache.catalina.startup.HostConfig.check(HostConfig.java:1451)
> at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)  
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>   
> at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>   
> at
> org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
>   
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
>   
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
>   
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: org.apache.cxf.interceptor.Fault: Could not add cxf jetty handler
> for url http://localhost:9080/camel-example-
> cxf-proxy/webservices/versionProxy to Jetty server, as the path
> /camel-example-cxf-proxy/webservices/versionProxy is
> still in use.
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.checkRegistedContext(JettyHTTPServerEngine.java:297
>   
> )
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:320)
>   
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)
> at
> org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49)
>   
> at
> org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)
>   
> at
> org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:895)
>   
> at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)
> at
> org.apache.camel.component.cxf.CxfConsumer.doStart(CxfConsumer.java:271)  
> at
> org.apache.camel.support.Serv

Re: Message router pattern : is this the best way to solve thousands of filter problem ?

2014-11-12 Thread Willem Jiang
Hi,

I think you need to do some work to aggregate these thousands of filters into 
tens filters.
Current Camel doesn’t has this kind of aggregation tools, but I think you may 
try to look at the drools[1] to see if it can apply these filters for you.

[1]http://www.drools.org/

--  
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 November 12, 2014 at 10:13:54 PM, Chris K (csa...@gmail.com) wrote:
> Hi all,
>  
> I'm writing an application that aggregate data from various sources.
> Data item comes with many attributes. Users interested with the data
> can create filters, to filter data based on data attributes
>  
> Example : data1 = { 'first_name':'Jimmy', 'last_name':'kurnia',
> 'title':'engineer', 'country':'Singapore', }
>  
> Say a user, user1, interested with data with these attributes :
> {'country':'Singapore'} and salary > 5
>  
> So every time a new data comes in, it has to go through all filters.
> If it matches the filter, the data would be sent in real time to the
> user by email
>  
> The problem : if, let say, there are 10K users, creating 10K filters,
> then 1 data item has to go through 10K filter. Is this something that
> can be solved efficiently using Message router pattern in Camel ?
>  
> If yes, how can I implement the solution using message router pattern
> in Camel ( pseudocode or sample would be appreciated )
>  
> regards,
> Chris
>  



Re: xmlsecurity endpoint output not "lasting"!?!?!?

2014-11-12 Thread Willem Jiang
Hi Gonzalo,

I’m glade that you find a way to solve the problem with Camel.
Please keep in mind reporting bugs could make Camel even better :)

--  
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 November 12, 2014 at 10:57:14 PM, Gonzalo Vasquez (gvasq...@altiuz.cl) wrote:
> Willem,
>  
> Switching to 2.15-SNAPSHOT made my day, as it provides support for the 
> parentXpath parameter  
> in the xmlsecurity endpoint. Although documentation is not correct as it says 
> that the  
> parentXpath has a String argument, it's not correct, as it expects a 
> javax.xml.crypto.dsig.spec.XPathFilterParameterSpec  
> parameter, that can be instantiated using something like:
>  
>  
>  
>  
>  
> And the later referenced using the pound sign (#) in the endpoint declaration 
> as in:
>  
> > />
>  
> Using this parameter I no longer need to create nor a dynamic endpoint, nor a 
> choice/when  
> condition, so I've managed to implement a workaround for the reported issue. 
> If I happen  
> to have sometime I'll make a test case and submit it to Jira.
>  
> Regards,
>  
> Gonzalo Vásquez Sáez
> Gerente Investigación y Desarrollo (R&D)
> Altiuz Soluciones Tecnológicas de Negocios Ltda.
> Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
> +56 2 335 2461
> gvasq...@altiuz.cl
> http://www.altiuz.cl
> http://www.altiuzreports.com
>  
>  
>  
> El 12-11-2014, a las 7:46, Willem Jiang escribió:
>  
> > Here are some information about it.
> > If you can still reproduce the error, you can create a JIRA[2] and submit a 
> > small test  
> case for it.
> >
> >
> > [1]http://camel.apache.org/maven-2-snapshot-repository-in-pom.html
> > [2]http://issues.apache.org/jira/browse/CAMEL
> >
> > --
> > 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 November 12, 2014 at 6:03:45 PM, Gonzalo Vasquez (gvasq...@altiuz.cl) 
> > wrote:
> >> Hi, I'm using 2.14.0, as I haven't been able to find a newer with Maven, is
> >> there a special repository for snapshots?
> >>
> >> On Wednesday, November 12, 2014, Willem Jiang
> >> wrote:
> >>
> >>> Hi
> >>>
> >>> Which version of Camel are you using?
> >>> I cannot reproduce the error with Apache Camel master branch (Camel
> >>> 2.15-SNAPSHOT).
> >>>
> >>> Regards,
> >>>
> >>> --
> >>> 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 November 12, 2014 at 6:20:13 AM, Gonzalo Vasquez (gvasq...@altiuz.cl
> >>> ) wrote:
>  Hi everybody,
> 
>  I'm having trouble with the output of the xmlsecurity endpoint. I
> >>> suppose the obvious
>  is to get the signed xml as in the body of the next endpoint, but it
> >>> seems a bit odd that it's
>  only kept as is if where a "local variable" as used in formal
> >>> programming languages, such
>  as variables defined in if/while/for loops, and no longer exists upon
> >>> exit.
> 
> 
>  Have I been clear of what is happening, or am I too messy in the
> >>> explanation?
> 
>  What I need is to use an endpoint such as:
> 
> > />
> 
> 
> 
>  As I need a flexible parentLocalName, I've tried two approaches:
> 
> 
> 
> >>> xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=${in.header.rootName}
> >>>   
> 
> 
>  And:
> 
> 
> 
> 
>  ${in.header.rootName} == 'factura'
> 
> >
> >>> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=factura"
> >>>   
>  />
> 
> 
> 
> 
> 
>  ${in.header.rootName} == 'notaDebito'
> 
> >
> >>> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=notaDebito"
> >>>   
>  />
> 
> 
> 
> 
> 
>  ${in.header.rootName} == 'comprobanteRetencion'
> 
> >
> >>> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=comprobanteRetencion"
> >>>   
>  />
> 
> 
> 
> 
> 
>  The first approach is the one I prefer, but it doesn't actually work as
> >>> expected as the
>  outside the "recipientList" the output body is the same as the input
> >>> (i.e. no Signature
>  node), but within the receipientList I can get the correctly signed
> >>> content.
> 
>  Although the second approach works, it's really messy because there's
> >>> too much duplicate
>  code due to the same problem described before, as also the signed
> >>> content (body) is only
>  present within the when tags, and not on the outside/end of the whole
> >>> choice tag.
> 
>  A workaround wou

Re: CXF webservice deployment on glassfish

2014-11-12 Thread Willem Jiang
Yeah, it should be cxf-rt-transports-http, and you need include the 
cxf-rt-transports-http-jetty there.

--  
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 November 13, 2014 at 5:13:59 AM, sab12in (sab1...@yahoo.co.in) wrote:
> Hi,
>  
> I have cxf-rt-transports-http-3.01.jar in my in my war file WEB-INF.lib.
> I dont have cxf-rt-http.jar, do you mean the same, if no then what is the
> maven depandancy for cxf-rt-http.jar.
>  
> Thanks and Regards,
> Sabyasachi
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/CXF-webservice-deployment-on-glassfish-tp5758405p5759011.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: How to configure proxy settings for cxf endpoint used in recipientList

2014-11-12 Thread Willem Jiang
10.1.107.71 is an internal network address, are you sure you need to use proxy 
to access it?

--  
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 November 12, 2014 at 6:27:44 PM, Aniruddha (aniruddha.di...@gmail.com) wrote:
> I can;t modify the wsdl to configure http client since its external service
> and i am calling that service.
> I also tried using camel-jetty and camel-http which have proxyHost,proxyPort
> proerpties set but they return me 503 http error code even though the target
> service is up and running.
>  
> Configuration with camel-http:
>  
>  
>  
>  
>  
>  
>  
>  
> POST
>  
>  
>  
> http://10.1.107.71:8080?proxyHost=bhuxegpx.corp.dmz&proxyPort=8080  
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758975.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: HalfOpen state implementation in CircuitBreaker

2014-11-12 Thread Willem Jiang
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 November 12, 2014 at 8:08:37 PM, Matteo Pavesi (pavesi.mat...@gmail.com) 
wrote:
> Hi all,
>  
> I would like to propose to implement the half open state as described in
> this diagram:
>  
> http://martinfowler.com/bliki/images/circuitBreaker/state.png.
>  
> When the halfOpenAfter timeout is reached, the circuitBreaker change into a
> HALF_OPEN state. If the next exchange is successful, the CircuitBreaker
> opens, otherwise it returns to the OPEN state again.
>  
> I created a CAMEL issue on jira and attached a possible implementation:
>  
> https://issues.apache.org/jira/browse/CAMEL-8039
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/HalfOpen-state-implementation-in-CircuitBreaker-tp5758988.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: CXF webservice deployment on glassfish

2014-11-12 Thread sab12in
Hi,

I have cxf-rt-transports-http-3.01.jar in my in my war file WEB-INF.lib.
I dont have cxf-rt-http.jar, do you mean the same, if no then what is the
maven depandancy for cxf-rt-http.jar.

Thanks and Regards,
Sabyasachi



--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-webservice-deployment-on-glassfish-tp5758405p5759011.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to configure proxy settings for cxf endpoint used in recipientList

2014-11-12 Thread Aniruddha
Hi camel experts,

could you pls help with this problem?

On Wed, Nov 12, 2014 at 9:26 PM, Aniruddha [via Camel] <
ml-node+s465427n5758975...@n5.nabble.com> wrote:

> I can;t modify the wsdl to configure http client since its external
> service and i am calling that service.
> I also tried using camel-jetty and camel-http which have
> proxyHost,proxyPort proerpties set but they return me 503 http error code
> even though the target service is up and running.
>
> Configuration with camel-http:
>
> 
>
> 
>
>  uri="bean:eventManagerUtils?method=setInHeaderProperties"/>
>  uri="xslt://transformation/notify-event-request.xsl"/>
> 
> 
>   POST
> 
> 
> 
> http://10.1.107.71:8080?proxyHost=bhuxegpx.corp.dmz&proxyPort=8080
> 
> 
> 
>  uri="seda:eventNotifyResponseProcessingQueue" />
>
>
> 
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758975.html
>  To unsubscribe from How to configure proxy settings for cxf endpoint used
> in recipientList, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5759010.html
Sent from the Camel - Users mailing list archive at Nabble.com.

XmlSecurity Endpoint: Adding KeyValue as KeyInfo child in signature

2014-11-12 Thread Gonzalo Vasquez
Dear list members,Can you please provide me hints on how to improve my current keyAccesor to achieve adding the KeyValue node in the KeyInfo element?Regarding the base64 encoded parts, how can I force the linebreaks to avoid never-ending lines?I'm also missing a Reference element in the SignedInfo, and don't know how to add it.Any additional comments would also be appreciated.Please see attached files:1.- signed.xml: current output format2.- signed2.xml: desired format3.- spring-ws-servlet.xml: current spring/camel config4.- Java Files: KeyAccesor / Selector



Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
+56 2 335 2461



gvasq...@altiuz.cl
http://www.altiuz.cl
http://www.altiuzreports.com


  












signed.xml
Description: XML document


signed2.xml
Description: XML document


RucKeyAccesor.java
Description: Binary data


X509KeySelector.java
Description: Binary data


Re: Strange issue with JDBC add Postgres

2014-11-12 Thread Tim Dudgeon

I already did. Described here:
http://camel.465427.n5.nabble.com/Strange-issue-with-JDBC-add-Postgres-tp5758548p5758657.html


Tim

On 12/11/2014 19:26, Claus Ibsen wrote:

There is a resetAutoCommit option, you can try set that to false

On Mon, Nov 10, 2014 at 1:54 PM, Tim Dudgeon  wrote:

I dug a bit deeper here and I think that Camel is doing something with the
connection, possibly related to autoCommit.
I worked around the problem by writing my own Processor that sets autoCommit
to false, sets maxRows on the statement and then iterates through the
ResultSet and a cursor does seem to be used as expected.
But trying to do the same with the Camel JDBC component fails for reasons
described earlier.

Tim

On 06/11/2014 18:57, Claus Ibsen wrote:

So maybe its your maxRows=1000 that is the problem, so when you are
trying to get rows > 1000 then it throws that exception.

What is your use case? You want to select * from a table, but only the
first 1000 rows?

On Wed, Nov 5, 2014 at 10:05 PM, Tim Dudgeon 
wrote:

On 05/11/2014 19:07, Claus Ibsen wrote:

maxRowSize ??? do you mean fetchSize?


Sorry, I mean maxRows (as in the example here:
http://camel.apache.org/jdbc.html).
So something like:


.to('jdbc:myDataSoruce?outputType=StreamList&statement.fetchSize=100&statement.maxRows=1000')



Also which version of Camel do you use?


2.14

Tim










Re: Strange issue with JDBC add Postgres

2014-11-12 Thread Claus Ibsen
There is a resetAutoCommit option, you can try set that to false

On Mon, Nov 10, 2014 at 1:54 PM, Tim Dudgeon  wrote:
> I dug a bit deeper here and I think that Camel is doing something with the
> connection, possibly related to autoCommit.
> I worked around the problem by writing my own Processor that sets autoCommit
> to false, sets maxRows on the statement and then iterates through the
> ResultSet and a cursor does seem to be used as expected.
> But trying to do the same with the Camel JDBC component fails for reasons
> described earlier.
>
> Tim
>
> On 06/11/2014 18:57, Claus Ibsen wrote:
>>
>> So maybe its your maxRows=1000 that is the problem, so when you are
>> trying to get rows > 1000 then it throws that exception.
>>
>> What is your use case? You want to select * from a table, but only the
>> first 1000 rows?
>>
>> On Wed, Nov 5, 2014 at 10:05 PM, Tim Dudgeon 
>> wrote:
>>>
>>> On 05/11/2014 19:07, Claus Ibsen wrote:

 maxRowSize ??? do you mean fetchSize?
>>>
>>>
>>> Sorry, I mean maxRows (as in the example here:
>>> http://camel.apache.org/jdbc.html).
>>> So something like:
>>>
>>>
>>> .to('jdbc:myDataSoruce?outputType=StreamList&statement.fetchSize=100&statement.maxRows=1000')
>>>
>>>
 Also which version of Camel do you use?
>>>
>>>
>>> 2.14
>>>
>>> Tim
>>>
>>
>>
>



-- 
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-leveldb : U​n​a​b​l​e​ ​t​o​ ​c​o​n​f​i​r​m​ ​e​x​c​h​a​n​g​e​I​d

2014-11-12 Thread Claus Ibsen
Hi

How have you configured camel-leveldb? I wonder for example if its you
set sync=false, and then the confirm cannot find it as it was not
flushed to disk, or something?



On Tue, Nov 11, 2014 at 1:58 PM, weebl  wrote:
> Using Camel 2.13.2, I get the same warning, not sure why it is happening.
> Looks to be aggregating fine, but having issues with "Completed" exchanges
> that are regarded as recoverable.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-leveldb-U-n-a-b-l-e-t-o-c-o-n-f-i-r-m-e-x-c-h-a-n-g-e-I-d-tp5756228p5758918.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: Problem with REST DSL (2.14.0) and String bean

2014-11-12 Thread Taariq Levack
Hi
Looks like camel-Jackson and camel-jaxb have different jaxb-api versions, 2.2 
and 2.2.7
Try excluding jaxb-api from one of them.

Taariq

> On 12 Nov 2014, at 10:52, Vaïsse-Lesteven Arthur  
> wrote:
> 
> Hi Claus,
> 
> Firstly, thank for your answer.
> 
> I currently use Maven to manage dependencies, and I do not specify different
> versions of Apache Camel nor in the POM nor in the dependency tree. As you
> suggested it, I double checked it again. But, because human beings are
> fallible, I link you the maven dependencies and the related dependencies
> tree in case there exist some not obvious ignored requirements such as
> activemq version must be 5.10.0 with camel 2.14.0.
> 
> I hope this help you to state whether or not the error is due to a version
> conflict. For now, I don't see any version conflict.
> 
> Here is the dependencies of my project (I provide links to avoid a very long
> post on the mailing list)
> pom.xml that specify dependencies : http://arthurvaisse.free.fr/work/pom.xml
> text file containing the dependency tree :
> http://arthurvaisse.free.fr/work/dependencies_tree.txt
> 
> 
> Vaisse-Lesteven Arthur
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Problem-with-REST-DSL-2-14-0-and-String-bean-tp5758812p5758965.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: xmlsecurity endpoint output not "lasting"!?!?!?

2014-11-12 Thread Gonzalo Vasquez
Willem,

Switching to 2.15-SNAPSHOT made my day, as it provides support for the 
parentXpath parameter in the xmlsecurity endpoint. Although documentation is 
not correct as it says that the parentXpath has a String argument, it's not 
correct, as it expects a javax.xml.crypto.dsig.spec.XPathFilterParameterSpec 
parameter, that can be instantiated using something like:





And the later referenced using the pound sign (#) in the endpoint declaration 
as in:



Using this parameter I no longer need to create nor a dynamic endpoint, nor a 
choice/when condition, so I've managed to implement a workaround for the 
reported issue. If I happen to have sometime I'll make a test case and submit 
it to Jira.

Regards,

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
+56 2 335 2461
gvasq...@altiuz.cl
http://www.altiuz.cl
http://www.altiuzreports.com
  


El 12-11-2014, a las 7:46, Willem Jiang  escribió:

> Here are some information about it.
> If you can still reproduce the error, you can create a JIRA[2] and submit a 
> small test case for it.
> 
> 
> [1]http://camel.apache.org/maven-2-snapshot-repository-in-pom.html
> [2]http://issues.apache.org/jira/browse/CAMEL
> 
> --  
> 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 November 12, 2014 at 6:03:45 PM, Gonzalo Vasquez (gvasq...@altiuz.cl) 
> wrote:
>> Hi, I'm using 2.14.0, as I haven't been able to find a newer with Maven, is
>> there a special repository for snapshots?
>> 
>> On Wednesday, November 12, 2014, Willem Jiang  
>> wrote:
>> 
>>> Hi
>>> 
>>> Which version of Camel are you using?
>>> I cannot reproduce the error with Apache Camel master branch (Camel
>>> 2.15-SNAPSHOT).
>>> 
>>> Regards,
>>> 
>>> --
>>> 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 November 12, 2014 at 6:20:13 AM, Gonzalo Vasquez (gvasq...@altiuz.cl
>>> ) wrote:
 Hi everybody,
 
 I'm having trouble with the output of the xmlsecurity endpoint. I
>>> suppose the obvious
 is to get the signed xml as in the body of the next endpoint, but it
>>> seems a bit odd that it's
 only kept as is if where a "local variable" as used in formal
>>> programming languages, such
 as variables defined in if/while/for loops, and no longer exists upon
>>> exit.
 
 
 Have I been clear of what is happening, or am I too messy in the
>>> explanation?
 
 What I need is to use an endpoint such as:
 
> />
 
 
 
 As I need a flexible parentLocalName, I've tried two approaches:
 
 
 
>>> xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=${in.header.rootName}
>>>   
 
 
 And:
 
 
 
 
 ${in.header.rootName} == 'factura'
 
> 
>>> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=factura"
>>>   
 />
 
 
 
 
 
 ${in.header.rootName} == 'notaDebito'
 
> 
>>> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=notaDebito"
>>>   
 />
 
 
 
 
 
 ${in.header.rootName} == 'comprobanteRetencion'
 
> 
>>> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=comprobanteRetencion"
>>>   
 />
 
 
 
 
 
 The first approach is the one I prefer, but it doesn't actually work as
>>> expected as the
 outside the "recipientList" the output body is the same as the input
>>> (i.e. no Signature
 node), but within the receipientList I can get the correctly signed
>>> content.
 
 Although the second approach works, it's really messy because there's
>>> too much duplicate
 code due to the same problem described before, as also the signed
>>> content (body) is only
 present within the when tags, and not on the outside/end of the whole
>>> choice tag.
 
 A workaround would be to redirect inside the recipientList to another
>>> route using a direct
 uri, but my doubt is if this is a bug in the xmlsecurity endpoint, am I
>>> doing something wrong
 or something else?
 
 Attached is the whole spring/camel xml file for you to review.
 
 Regards,
 Gonzalo Vásquez Sáez
 Gerente Investigación y Desarrollo (R&D)
 Altiuz Soluciones Tecnológicas de Negocios Ltda.
 Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
 +56 2 335 2461
 gvasq...@altiuz.cl  
 http://www.altiuz.cl
 http://www.altiuzreports.com
 
 
 
>>> 
>>> 
>> 
> 



Message router pattern : is this the best way to solve thousands of filter problem ?

2014-11-12 Thread Chris K
Hi all,

I'm writing an application that aggregate data from various sources.
Data item comes with many attributes. Users interested with the data
can create filters, to filter data based on data attributes

Example :  data1 = { 'first_name':'Jimmy', 'last_name':'kurnia',
'title':'engineer', 'country':'Singapore', }

Say a user, user1, interested with data with these attributes :
{'country':'Singapore'} and salary > 5

So every time a new data comes in, it has to go through all filters.
If it matches the filter, the data would be sent in real time to the
user by email

The problem : if, let say, there are 10K users, creating 10K filters,
then 1 data item has to go through 10K filter. Is this something that
can be solved efficiently using Message router pattern in Camel ?

If yes, how can I implement the solution using message router pattern
in Camel ( pseudocode or sample would be appreciated )

regards,
Chris


HalfOpen state implementation in CircuitBreaker

2014-11-12 Thread Matteo Pavesi
Hi all,

I would like to propose to implement the half open state as described in
this diagram:

http://martinfowler.com/bliki/images/circuitBreaker/state.png.

When the halfOpenAfter timeout is reached, the circuitBreaker change into a
HALF_OPEN state. If the next exchange is successful, the CircuitBreaker
opens, otherwise it returns to the OPEN state again.

I created a CAMEL issue on jira and attached a possible implementation:

https://issues.apache.org/jira/browse/CAMEL-8039



--
View this message in context: 
http://camel.465427.n5.nabble.com/HalfOpen-state-implementation-in-CircuitBreaker-tp5758988.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Error while deploying camel proxy in tomcat

2014-11-12 Thread Royamit
Hi,

I have created a proxy webservice which i have hosted on tomcat.
Also i am monitoring the camel-config.xml for any changes.
If there is any change in camel-config.xml, tomcat tries to redeploy the
proxy service war.
But while redploying i get the following error : - 

org.apache.camel.RuntimeCamelException: org.apache.cxf.interceptor.Fault:
Could not add cxf jetty handler for url http:/
/localhost:9080/camel-example-cxf-proxy/webservices/versionProxy to Jetty
server, as the path /camel-example-cxf-proxy/
webservices/versionProxy is still in use.
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMult
icaster.java:96)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:3
34)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:
948)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java
:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java
:93)
at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:217)
at org.apache.camel.spring.Main.doStart(Main.java:157)
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.example.cxf.proxy.MyMain.init(MyMain.java:32)
at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.StandardContext.reload(StandardContext.java:3920)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1357)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1451)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.cxf.interceptor.Fault: Could not add cxf jetty handler
for url http://localhost:9080/camel-example-
cxf-proxy/webservices/versionProxy to Jetty server, as the path
/camel-example-cxf-proxy/webservices/versionProxy is
 still in use.
at
org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.checkRegistedContext(JettyHTTPServerEngine.java:297
)
at
org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:320)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)
at
org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49)
at
org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)
at
org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:895)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)
at
org.apache.camel.component.cxf.CxfConsumer.doStart(CxfConsumer.java:271)
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2158)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:2452)
at
org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:2388)
at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServi

Re: xmlsecurity endpoint output not "lasting"!?!?!?

2014-11-12 Thread Willem Jiang
Here are some information about it.
If you can still reproduce the error, you can create a JIRA[2] and submit a 
small test case for it.


[1]http://camel.apache.org/maven-2-snapshot-repository-in-pom.html
[2]http://issues.apache.org/jira/browse/CAMEL

--  
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 November 12, 2014 at 6:03:45 PM, Gonzalo Vasquez (gvasq...@altiuz.cl) wrote:
> Hi, I'm using 2.14.0, as I haven't been able to find a newer with Maven, is
> there a special repository for snapshots?
>  
> On Wednesday, November 12, 2014, Willem Jiang  
> wrote:
>  
> > Hi
> >
> > Which version of Camel are you using?
> > I cannot reproduce the error with Apache Camel master branch (Camel
> > 2.15-SNAPSHOT).
> >
> > Regards,
> >
> > --
> > 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 November 12, 2014 at 6:20:13 AM, Gonzalo Vasquez (gvasq...@altiuz.cl
> > ) wrote:
> > > Hi everybody,
> > >
> > > I'm having trouble with the output of the xmlsecurity endpoint. I
> > suppose the obvious
> > > is to get the signed xml as in the body of the next endpoint, but it
> > seems a bit odd that it's
> > > only kept as is if where a "local variable" as used in formal
> > programming languages, such
> > > as variables defined in if/while/for loops, and no longer exists upon
> > exit.
> > >
> > >
> > > Have I been clear of what is happening, or am I too messy in the
> > explanation?
> > >
> > > What I need is to use an endpoint such as:
> > >
> > > > />
> > >
> > >
> > >
> > > As I need a flexible parentLocalName, I've tried two approaches:
> > >
> > >
> > >
> > xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=${in.header.rootName}
> >   
> > >
> > >
> > > And:
> > >
> > >
> > >
> > >
> > > ${in.header.rootName} == 'factura'
> > >
> > > >
> > uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=factura"
> >   
> > > />
> > >
> > >
> > >
> > >
> > >
> > > ${in.header.rootName} == 'notaDebito'
> > >
> > > >
> > uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=notaDebito"
> >   
> > > />
> > >
> > >
> > >
> > >
> > >
> > > ${in.header.rootName} == 'comprobanteRetencion'
> > >
> > > >
> > uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=comprobanteRetencion"
> >   
> > > />
> > >
> > >
> > >
> > >
> > >
> > > The first approach is the one I prefer, but it doesn't actually work as
> > expected as the
> > > outside the "recipientList" the output body is the same as the input
> > (i.e. no Signature
> > > node), but within the receipientList I can get the correctly signed
> > content.
> > >
> > > Although the second approach works, it's really messy because there's
> > too much duplicate
> > > code due to the same problem described before, as also the signed
> > content (body) is only
> > > present within the when tags, and not on the outside/end of the whole
> > choice tag.
> > >
> > > A workaround would be to redirect inside the recipientList to another
> > route using a direct
> > > uri, but my doubt is if this is a bug in the xmlsecurity endpoint, am I
> > doing something wrong
> > > or something else?
> > >
> > > Attached is the whole spring/camel xml file for you to review.
> > >
> > > Regards,
> > > Gonzalo Vásquez Sáez
> > > Gerente Investigación y Desarrollo (R&D)
> > > Altiuz Soluciones Tecnológicas de Negocios Ltda.
> > > Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
> > > +56 2 335 2461
> > > gvasq...@altiuz.cl  
> > > http://www.altiuz.cl
> > > http://www.altiuzreports.com
> > >
> > >
> > >
> >
> >
>  



Re: Multipart form data and servlet/restlet endpoint

2014-11-12 Thread navaltiger
Hi,

With Jetty based consumer it worked but no luck with servlet.  I am
executing this package as jetty:run

public void configure() throws Exception { 
//  getContext().getProperties().put("CamelJettyTempDir", "target");

// Jetty://http works file
//  from("jetty://http://0.0.0.0:9090/test";).process(new 
Processor() {
.// servlet:// does not work
from("servlet:///test").process(new Processor() {
public void process(Exchange exchange) throws Exception 
{

Message in = exchange.getIn();
StringBuffer v = new StringBuffer();

v.append("\n" + in.getAttachmentNames().size() 
+ "\n");
 
Set names = in.getAttachmentNames();
for (String n : names) {
DataHandler h = in.getAttachment(n);
v.append("\n" + h + "\n");
if (h != null) {
try {
int read = 0;
byte[] bytes = new 
byte[1024];
// Object o = 
h.getContent();
InputStream inputStream 
= h.getInputStream();
FileOutputStream fout = 
new FileOutputStream(
new 
File(

"/Users/navaltiger/workspace/vr.bin"));

while ((read = 
inputStream.read(bytes)) != -1) {

fout.write(bytes, 0, read);
}
v.append("\n done \n");
} catch (Exception e) {
e.printStackTrace();
}
}
}
exchange.getOut().setBody(v);
}

}); 
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5758976.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to configure proxy settings for cxf endpoint used in recipientList

2014-11-12 Thread Aniruddha
I can;t modify the wsdl to configure http client since its external service
and i am calling that service.
I also tried using camel-jetty and camel-http which have proxyHost,proxyPort
proerpties set but they return me 503 http error code even though the target
service is up and running.

Configuration with camel-http:



   





  POST



http://10.1.107.71:8080?proxyHost=bhuxegpx.corp.dmz&proxyPort=8080









--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758975.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: xmlsecurity endpoint output not "lasting"!?!?!?

2014-11-12 Thread Gonzalo Vasquez
Hi, I'm using 2.14.0, as I haven't been able to find a newer with Maven, is
there a special repository for snapshots?

On Wednesday, November 12, 2014, Willem Jiang 
wrote:

> Hi
>
> Which version of Camel are you using?
> I cannot reproduce the error with Apache Camel master branch (Camel
> 2.15-SNAPSHOT).
>
> Regards,
>
> --
> 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 November 12, 2014 at 6:20:13 AM, Gonzalo Vasquez (gvasq...@altiuz.cl
> ) wrote:
> > Hi everybody,
> >
> > I'm having trouble with the output of the xmlsecurity endpoint. I
> suppose the obvious
> > is to get the signed xml as in the body of the next endpoint, but it
> seems a bit odd that it's
> > only kept as is if where a "local variable" as used in formal
> programming languages, such
> > as variables defined in if/while/for loops, and no longer exists upon
> exit.
> >
> >
> > Have I been clear of what is happening, or am I too messy in the
> explanation?
> >
> > What I need is to use an endpoint such as:
> >
> > > />
> >
> >
> >
> > As I need a flexible parentLocalName, I've tried two approaches:
> >
> >
> >
> xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=${in.header.rootName}
> >
> >
> > And:
> >
> >
> >
> >
> > ${in.header.rootName} == 'factura'
> >
> > >
> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=factura"
> > />
> >
> >
> >
> >
> >
> > ${in.header.rootName} == 'notaDebito'
> >
> > >
> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=notaDebito"
> > />
> >
> >
> >
> >
> >
> > ${in.header.rootName} == 'comprobanteRetencion'
> >
> > >
> uri="xmlsecurity:sign://enveloped?keyAccessor=#keyAccessor&parentLocalName=comprobanteRetencion"
> > />
> >
> >
> >
> >
> >
> > The first approach is the one I prefer, but it doesn't actually work as
> expected as the
> > outside the "recipientList" the output body is the same as the input
> (i.e. no Signature
> > node), but within the receipientList I can get the correctly signed
> content.
> >
> > Although the second approach works, it's really messy because there's
> too much duplicate
> > code due to the same problem described before, as also the signed
> content (body) is only
> > present within the when tags, and not on the outside/end of the whole
> choice tag.
> >
> > A workaround would be to redirect inside the recipientList to another
> route using a direct
> > uri, but my doubt is if this is a bug in the xmlsecurity endpoint, am I
> doing something wrong
> > or something else?
> >
> > Attached is the whole spring/camel xml file for you to review.
> >
> > Regards,
> > Gonzalo Vásquez Sáez
> > Gerente Investigación y Desarrollo (R&D)
> > Altiuz Soluciones Tecnológicas de Negocios Ltda.
> > Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
> > +56 2 335 2461
> > gvasq...@altiuz.cl 
> > http://www.altiuz.cl
> > http://www.altiuzreports.com
> >
> >
> >
>
>


Re: Problem with REST DSL (2.14.0) and String bean

2014-11-12 Thread Vaïsse-Lesteven Arthur
Hi Claus,

Firstly, thank for your answer.

I currently use Maven to manage dependencies, and I do not specify different
versions of Apache Camel nor in the POM nor in the dependency tree. As you
suggested it, I double checked it again. But, because human beings are
fallible, I link you the maven dependencies and the related dependencies
tree in case there exist some not obvious ignored requirements such as
activemq version must be 5.10.0 with camel 2.14.0.

I hope this help you to state whether or not the error is due to a version
conflict. For now, I don't see any version conflict.

Here is the dependencies of my project (I provide links to avoid a very long
post on the mailing list)
pom.xml that specify dependencies : http://arthurvaisse.free.fr/work/pom.xml
text file containing the dependency tree :
http://arthurvaisse.free.fr/work/dependencies_tree.txt


Vaisse-Lesteven Arthur



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-REST-DSL-2-14-0-and-String-bean-tp5758812p5758965.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Update mongoDb objects from blueprint xml routes

2014-11-12 Thread Henryk Konsek
Hi,

> Is it possibile to update MongoDb Objects from a route defined in a
> blueprint XML file?

Sure it is :) .

> I cannot find an example of creating a List
> without java code.

Yeah, the route itself can be defined in XML, but the body you send
into that route may require something more expressive than XML :) . If
you would like to set some non-trivial body in the route (like
DbObject instance), you can consider using Groovy component [1] for
that:


  new DbObject(...)


However in most cases you would like to create the body outside the
route and send it to the consumer starting that route.

Cheers.

[1] http://camel.apache.org/groovy.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com