Re: Camel DSL & WMQ ... Not Working as expected

2016-05-25 Thread yogu13
This should help u..http://camel.apache.org/graceful-shutdown.html

Regards,
-Yogesh

On Wed, May 25, 2016 at 4:49 PM, N.S.KARTHIK [via Camel] <
ml-node+s465427n5783070...@n5.nabble.com> wrote:

> Hi
>
> Thx for the suggestion
>
> Used the following
>
> main.enableHangupSupport();
>  //main.start();
>  main.run();
>
> This actually helped me in getting the values...thx to u.
>
> Question : If i need to have a Clean Shutdown ...How to handle the same ?
>
>
> with regards
> Karthik
>
>
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-DSL-WMQ-Not-Working-as-expected-tp5782772p5783070.html
> To unsubscribe from Camel DSL & WMQ ... Not Working as expected, click
> here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-DSL-WMQ-Not-Working-as-expected-tp5782772p5783084.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF jaxrs custome exception mapper with camel

2016-05-25 Thread arno noordover
Changes of jira-issue are available in
https://fisheye6.atlassian.com/changelog/camel-git?cs=94c01b98dfd0b4140a7ff51c47222b1f728ce45e
These changes are also available in your version.
The unittest call toResponse in CustomExceptionMapper.
Can you compare your solution with the unittest provided in this commit.



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


i'm so excited

2016-05-25 Thread sanjai
Hello! Just take a look at the info I just found, I'm so excited, check it out 
at 

Very truly yours, san...@sanjai.org





--
View this message in context: 
http://camel.465427.n5.nabble.com/i-m-so-excited-tp5783087.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File component: Dynamically decide whether a file should be deleted or not

2016-05-25 Thread jmsst
Claus Ibsen-2 wrote
> What should happen if you do not want to delete the file? Should it
> stay in the directory or be moved?

It should stay in the directory.

I've done it now the following way:
If I want to not delete the file, I throw an exception and catch the
exception with
onException(FileShouldNotBeDeletedException.class).handled(false).stop();

I don't really like this approach and I don't really like the approach with
another "delete" directory either. But OK this are possible ways. I thought
there might be a way to decide dynamically if delete should be applied or
not even without an exception. But I can't find anything like that.

Regards
Johannes




--
View this message in context: 
http://camel.465427.n5.nabble.com/File-component-Dynamically-decide-whether-a-file-should-be-deleted-or-not-tp5782842p5783086.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Schematron files accessed over http

2016-05-25 Thread jamesburn
Hi

I'm trying to implement a camel route TO a schematron file which I have
hosted on our (local) http server.

I've got the line:
http://oup.com/Ref/Schematron/BasicSchematron.sch"/>

however, I get error:

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint:
schematron://http://oup.com/Ref/Schematron/BasicSchematron.sch due to: File
'http:/oup.com/Ref/Schematron/BasicSchematron.sch' does not exist

I see on  http://camel.apache.org/schematron.html
   that path can be either file
system or class path, but is it possible to access a schematron file with
Camel over http? I tried various options in the  but to no avail.

If not possible this would be a very useful addition. All our schema for
camel validator are accessed over http.

Thanks

James



--
View this message in context: 
http://camel.465427.n5.nabble.com/Schematron-files-accessed-over-http-tp5783076.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Returning response from external webservice using dynamicRouter

2016-05-25 Thread maskellp
Hi,

I am new to Camel so please allow for Newbie issues.

I have a Camel Route in java as follows :

public void configure() throws Exception {
from("servlet:routeTest")
.to("log:input")
.to("activemq:queue:inbox");

from("activemq:queue:inbox")
.dynamicRouter(method(DynamicRouter.class, "route"))
.log("${body}");
}


This is bundled in a war deployed on tomcat, this calls the route method as
follows :

public String route(Exchange exchange) {
if (exchange.getIn().getHeader("Server") == null) {
if
(checkBodyToDeterminServer(exchange.getIn().getBody(String.class)))
return
"http4://server1/webservices/ClientService?bridgeEndpoint=true&throwExceptionOnFailure=false";
return
"http4://server2/webservices/ClientService?bridgeEndpoint=true&throwExceptionOnFailure=false";
}
return null;
}

This routes to server 1 and 2 correctly, my question, is
'exchange.getIn().getHeader("Server") == null' the best way to determine
where I am in flow and not process the route on return from the server?

If I call server 1 or 2 directly from soapUi I get a success xml message, I
see this in the body in the route method, but it doesn't get passed back to
the originating soapUi, what step am I missing?

Hope this makes sense.

Thanks in advance.

Phil Maskell



--
View this message in context: 
http://camel.465427.n5.nabble.com/Returning-response-from-external-webservice-using-dynamicRouter-tp5783073.html
Sent from the Camel - Users mailing list archive at Nabble.com.


process failed

2016-05-25 Thread miri eyni
hi

 i am try in process method call to another API for get metadata that should
be part of the request for 
the target endpoint 
public void process(Exchange exchange) throws Exception {
ProducerTemplate template =
exchange.getContext().createProducerTemplate();
 CxfComponent cxfComponent = new 
CxfComponent(exchange.getContext());   
 CxfRsEndpoint endpoint = new
CxfRsEndpoint("http://localhost:8080/occupations"; ,cxfComponent);
 
Exchange targetExchange =template.send(endpoint, exchange);
String body = targetExchange.getIn().getBody(String.class);


}

on the processing i got nullPointerException because the binding is null.





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


Re: Apache Camel connect but does not download files from external FTP

2016-05-25 Thread GuilhermeRN
I succeded yesterday to make it work. The problem was the passive mode Claus
quoted.
Actually, I had tried it before but camel was complaining about the sintax
of it and I moved on to try other things.
In the FAQ :
http://camel.apache.org/why-does-ftp-component-not-download-any-files.html
the parameter is misspelled. There, we have "passiveMove" rather than
"passiveMode". Toke a little time to find another source of the parameter.

Anyways, thank you so much for the support and congratulations for the
framework.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-connect-but-does-not-download-files-from-external-FTP-tp5783051p5783071.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel DSL & WMQ ... Not Working as expected

2016-05-25 Thread N.S.KARTHIK
Hi

Thx for the suggestion

Used the following

main.enableHangupSupport();
 //main.start();
 main.run();

This actually helped me in getting the values...thx to u.

Question : If i need to have a Clean Shutdown ...How to handle the same ?


with regards
Karthik






--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-DSL-WMQ-Not-Working-as-expected-tp5782772p5783070.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Routing question

2016-05-25 Thread arno noordover
I would take a look at http://camel.apache.org/content-enricher.html

If you don't want to use a AggregrationStrategy you could do the following
in a route:
1. call the first endpoint;
2. move the payload to a header (setHeader);
3. call second endpoint;
4. move the payload to another header;
5. call third endpoint;
6. use some kind of scripting or whatever to create a new payload en call
methods on it using the headers from step 2 and 4.

Another solution might be to use http://camel.apache.org/multicast.html.
I think that using the GroupedExchangeAggregationStrategy you get a List in
the payload containing all the responses.



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


Re: move alternate files to different folder

2016-05-25 Thread pp
Thanks for the info.  



--
View this message in context: 
http://camel.465427.n5.nabble.com/move-alternate-files-to-different-folder-tp5782984p5783074.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Error in Karaf: Unknown protocol: mvn

2016-05-25 Thread alexey-s
In the file camel-core-2.17.1.jar, internal file META-INF/MANIFEST.MF have
row
Ignore-Package: com.googlecode.concurrentlinkedhashmap

but this package use in class org.apache.camel.util.LRUCache.

It's errror for OSGi.

Add this package to parameter Import-Package, or change usage classes 
ConcurrentLinkedHashMap and EvictionListener from package
"com.googlecode.concurrentlinkedhashmap" to
"org.apache.camel.com.googlecode.concurrentlinkedhashmap".


Regards, Alexey



--
View this message in context: 
http://camel.465427.n5.nabble.com/Error-in-Karaf-Unknown-protocol-mvn-tp5783042p5783060.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Routing question

2016-05-25 Thread miri eyni
i didn't try it.

where can i store the responses values? 

i need call to different APIs to get metadata before i call to target
request ?


thanks 




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


Re: Camel netty detect client disconnect

2016-05-25 Thread souciance
Just in case anyone else runs into this, I had to reuse a lot of the code
found here:
https://github.com/apache/camel/blob/master/components/camel-netty/src/main/java/org/apache/camel/component/netty/handlers/ServerChannelHandler.java

You can then generate a unique client id like this:

uniqueClientId =
String.valueOf(ctx.channel().hashCode()).concat(String.valueOf(ctx.channel().remoteAddress())).concat(String.valueOf(ctx.channel().localAddress()));

>From the channel inactive method you can generate a message to put on the
exchange. In your route, you have to catch the message, do your disconnect
cleanup and then stop processing the exchange otherwise you will client
channel disconnect error since channel will have disconnected although the
route is actually an InOut.


On Mon, May 23, 2016 at 5:18 PM, souciance [via Camel] <
ml-node+s465427n578296...@n5.nabble.com> wrote:

> Hello,
>
> Is there any way for the camel netty 4 component to detect when a client
> channel has disconnected? I need to clear out some data specific to clients
> when they disconnect.
>
> I know if I write my own handler than I can access the netty methods to
> listen for disconnect events but was wondering if these are exposed via
> Camel or if there is another recommended approach? Otherwise I would be
> duplicating a lot of the code already written here:
>
> https://github.com/apache/camel/blob/337a6756480354afea7531a1a4216de9d232f211/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/handlers/ServerChannelHandler.java
>
> Best
> Souciance
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-netty-detect-client-disconnect-tp5782966.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-netty-detect-client-disconnect-tp5782966p5783059.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Apache Camel connect but does not download files from external FTP

2016-05-25 Thread Claus Ibsen
Yeah

And also mind about passive and active mode
http://stackoverflow.com/questions/1699145/what-is-the-difference-between-active-and-passive-ftp

On Wed, May 25, 2016 at 9:00 AM, souciance
 wrote:
> Can you download the file manually via FTP from the ec2 machine? Just so
> you verify that it actually works from that particular host.
>
> On Wed, May 25, 2016 at 3:18 AM, GuilhermeRN [via Camel] <
> ml-node+s465427n5783051...@n5.nabble.com> wrote:
>
>> Hi!
>>
>> I'm running a standalone camel route.
>> When I run my Main.class locally in (Eclipse->Run-As->Java Application) it
>> works fine. The file is consumed from the external FTP and all the route
>> works.
>>
>> However, when I am im my ec2 and do git-clone from my repository and
>> perform mvn package -> mvn exec:java of the same project it runs normally
>> but only ping the FTP endpoint, not downloading the file.
>>
>> I checked all the jars in my dependency-jars file(in my ec2) and they are
>> the same as in the Eclipse maven-dependencies(locally)
>>
>> my pom with the versions and etc looks like:
>>
>> 
>> http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/maven-v4_0_0.xsd";>
>>
>> 4.0.0
>>
>> myGroupId
>> myApp
>> 0.0.1-SNAPSHOT
>> jar
>> MyApp
>> myUrl
>>
>> 
>> UTF-8
>>
>> UTF-8
>>
>> 1.7.10
>> 1.2.17
>> 4.11
>> 2.15.2
>> 3.4
>> 1.2
>> 2.4
>> 2.6
>> 2.3.0
>> 0.6.2
>> 1.6.0
>> 
>>
>> 
>> 
>> release.fusesource.org
>> FuseSource Release Repository
>> 
>> http://repo.fusesource.com/nexus/content/repositories/releases
>> 
>> false
>> 
>> 
>> true
>> 
>> 
>> 
>> ea.fusesource.org
>> FuseSource Community Early Access Release
>> Repository
>> http://repo.fusesource.com/nexus/content/groups/ea
>> 
>> false
>> 
>> 
>> true
>> 
>> 
>> 
>>
>> 
>> 
>> release.fusesource.org
>> FuseSource Release Repository
>> 
>> http://repo.fusesource.com/nexus/content/repositories/releases
>> 
>> false
>> 
>> 
>> true
>> 
>> 
>> 
>> ea.fusesource.org
>> FuseSource Community Early Access Release
>> Repository
>> http://repo.fusesource.com/nexus/content/groups/ea
>> 
>> false
>> 
>> 
>> true
>> 
>> 
>> 
>>
>> 
>> 
>> com.atomikos
>> transactions-jta
>> 3.9.3
>> 
>>
>>
>>
>>
>>
>>
>> 
>> org.apache.camel
>> camel-core
>> ${camel.version}
>> 
>> 
>> org.apache.camel
>> camel-spring
>> ${camel.version}
>> 
>>
>> 
>> org.apache.camel
>> camel-ftp
>> ${camel.version}
>> 
>>
>>
>> 
>> org.apache.ftpserver
>> ftpserver-core
>> 1.0.6
>> 
>>
>>
>>
>> 
>> org.apache.camel
>> camel-bindy
>> ${camel.version}
>> 
>> 
>> org.apache.camel
>> camel-jaxb
>> ${camel.version}
>> 
>> 
>> org.apache.activemq
>> activemq-camel
>> 5.11.1
>> 
>>
>> 
>> org.apache.commons
>> commons-lang3
>> ${commons.lang3.version}
>> 
>>
>> 
>> joda-time
>> joda-time
>> ${joda.time.version}
>> 
>>
>> 
>> org.apache.camel
>> camel-test-spring
>> ${camel.version}
>> test
>> 
>>
>> 
>> org.apache.camel
>> camel-jms
>> ${camel.version}
>> 
>>
>> 
>> javax.servlet
>> javax.servlet-api
>> 4.0.0-b01
>> 
>>
>> 
>> org.apache.derby
>> derby
>> 10.10.1.1
>> 
>>
>> 
>> org.postgresql
>> postgresql
>> 9.3-1103-jdbc41
>> 
>>
>>  
>> org.springframework
>> spring-orm
>> 4.1.6.RELEASE
>>  
>>
>>  
>> org.springframework
>> spring-jdbc
>> 4.1.6.RELEASE
>> 
>>
>> 
>> org.hibernate
>> hibernate-core
>> 4.2.15.Fina

Re: Apache Camel connect but does not download files from external FTP

2016-05-25 Thread souciance
Can you download the file manually via FTP from the ec2 machine? Just so
you verify that it actually works from that particular host.

On Wed, May 25, 2016 at 3:18 AM, GuilhermeRN [via Camel] <
ml-node+s465427n5783051...@n5.nabble.com> wrote:

> Hi!
>
> I'm running a standalone camel route.
> When I run my Main.class locally in (Eclipse->Run-As->Java Application) it
> works fine. The file is consumed from the external FTP and all the route
> works.
>
> However, when I am im my ec2 and do git-clone from my repository and
> perform mvn package -> mvn exec:java of the same project it runs normally
> but only ping the FTP endpoint, not downloading the file.
>
> I checked all the jars in my dependency-jars file(in my ec2) and they are
> the same as in the Eclipse maven-dependencies(locally)
>
> my pom with the versions and etc looks like:
>
> 
> http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd";>
>
> 4.0.0
>
> myGroupId
> myApp
> 0.0.1-SNAPSHOT
> jar
> MyApp
> myUrl
>
> 
> UTF-8
>
> UTF-8
>
> 1.7.10
> 1.2.17
> 4.11
> 2.15.2
> 3.4
> 1.2
> 2.4
> 2.6
> 2.3.0
> 0.6.2
> 1.6.0
> 
>
> 
> 
> release.fusesource.org
> FuseSource Release Repository
> 
> http://repo.fusesource.com/nexus/content/repositories/releases
> 
> false
> 
> 
> true
> 
> 
> 
> ea.fusesource.org
> FuseSource Community Early Access Release
> Repository
> http://repo.fusesource.com/nexus/content/groups/ea
> 
> false
> 
> 
> true
> 
> 
> 
>
> 
> 
> release.fusesource.org
> FuseSource Release Repository
> 
> http://repo.fusesource.com/nexus/content/repositories/releases
> 
> false
> 
> 
> true
> 
> 
> 
> ea.fusesource.org
> FuseSource Community Early Access Release
> Repository
> http://repo.fusesource.com/nexus/content/groups/ea
> 
> false
> 
> 
> true
> 
> 
> 
>
> 
> 
> com.atomikos
> transactions-jta
> 3.9.3
> 
>
>
>
>
>
>
> 
> org.apache.camel
> camel-core
> ${camel.version}
> 
> 
> org.apache.camel
> camel-spring
> ${camel.version}
> 
>
> 
> org.apache.camel
> camel-ftp
> ${camel.version}
> 
>
>
> 
> org.apache.ftpserver
> ftpserver-core
> 1.0.6
> 
>
>
>
> 
> org.apache.camel
> camel-bindy
> ${camel.version}
> 
> 
> org.apache.camel
> camel-jaxb
> ${camel.version}
> 
> 
> org.apache.activemq
> activemq-camel
> 5.11.1
> 
>
> 
> org.apache.commons
> commons-lang3
> ${commons.lang3.version}
> 
>
> 
> joda-time
> joda-time
> ${joda.time.version}
> 
>
> 
> org.apache.camel
> camel-test-spring
> ${camel.version}
> test
> 
>
> 
> org.apache.camel
> camel-jms
> ${camel.version}
> 
>
> 
> javax.servlet
> javax.servlet-api
> 4.0.0-b01
> 
>
> 
> org.apache.derby
> derby
> 10.10.1.1
> 
>
> 
> org.postgresql
> postgresql
> 9.3-1103-jdbc41
> 
>
>  
> org.springframework
> spring-orm
> 4.1.6.RELEASE
>  
>
>  
> org.springframework
> spring-jdbc
> 4.1.6.RELEASE
> 
>
> 
> org.hibernate
> hibernate-core
> 4.2.15.Final
> 
>
> 
> com.fasterxml.jackson.core
> jackson-core
> ${jackson.version}
> 
>
> 
> org.apache.httpcomponents
> httpclient
> 4.5.1
> 
>
>
>
>
> 
>   org.slf4j
>   slf4j-api
>   1.7.5
> 
> 
>   org.slf4j
>   slf4j-log4j12
>   1.7.5
>