Unexpected shutdow of the Camel context

2016-03-07 Thread ursouca
Dears,

I have a strange issue.
I have an JEE application (ear) that I deployed on a Frontend servers (2)
and Backend servers (2). The same ear is deployed on all servers and a
property file is used to activate or not the components and or camel routes
on particular servers.
I am using Camel version 2.16.2 Spring 4.2.4 and defined the routes in
Spring XML (Spring-camel):

1) route reading from direct endpoint to send a jpa endpoint to persit the
message. this message will be read by route 2) (jpa endpoint)
2) route reading from a jpa endpoint to read message to process by enriching
the message that will be sent to route 3) (direct endpoint)
3) route reading from a direct enpoint (feeded by route 2) to aggragate the
message and sending the aggegated message to a bean endpoint.

I ordered the startup of the routes to be sure that their are always
reachable.

On all server the Camel context is configured with autostatup to true in the
Spring XML context.
On the Frontend servers only route 1 is activated. 
On backend servers all the three routes are activated.

Logically everything seems OK for me. But after a while (couples of days at
least 4 or 5) the we observer in the log the the context is shuting down and
there for the only route activate becomes unusable.
What can triggers the context to be shutdown?

I joinded the full configuration and I hope someone can point what parameter
is wrong or missing. Is this link to a default shutdow startegy?

CamelContext.xml
  

Thanks in advance,
Cataldo.





--
View this message in context: 
http://camel.465427.n5.nabble.com/Unexpected-shutdow-of-the-Camel-context-tp5778699.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-websocket installation hangs

2016-03-07 Thread Trey
I'm using Karaf 4.0.4 with Oracle Java 8 and trying to install
camel-websocket 2.16.2 and the install hangs.

Here are the logs after turning on DEBUG.  I don't have issues installing
any other camel features.

2016-03-07 15:11:29,457 | DEBUG | 127.0.0.1:4] | proxy  
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: host: 127.0.0.1, port: 4
2016-03-07 15:11:29,488 | DEBUG | ion(7)-127.0.0.1 | tcp
 
|  -  -  | RMI TCP Connection(7)-127.0.0.1: accepted socket from
[127.0.0.1:37067]
2016-03-07 15:11:29,492 | DEBUG | ion(7)-127.0.0.1 | tcp
 
|  -  -  | RMI TCP Connection(7)-127.0.0.1: (port 4) op = 80
2016-03-07 15:11:29,492 | DEBUG | ion(7)-127.0.0.1 | loader 
 
|  -  -  | RMI TCP Connection(7)-127.0.0.1: name =
"[Ljava.rmi.server.ObjID;", codebase = ""
2016-03-07 15:11:29,492 | DEBUG | ion(7)-127.0.0.1 | loader 
 
|  -  -  | RMI TCP Connection(7)-127.0.0.1: name = "java.rmi.dgc.Lease",
codebase = ""
2016-03-07 15:11:29,492 | DEBUG | ion(7)-127.0.0.1 | loader 
 
|  -  -  | RMI TCP Connection(7)-127.0.0.1: name = "java.rmi.dgc.VMID",
codebase = ""
2016-03-07 15:11:29,492 | DEBUG | ion(7)-127.0.0.1 | loader 
 
|  -  -  | RMI TCP Connection(7)-127.0.0.1: name = "[B", codebase = ""
2016-03-07 15:11:29,492 | DEBUG | ion(7)-127.0.0.1 | loader 
 
|  -  -  | RMI TCP Connection(7)-127.0.0.1: name = "java.rmi.server.UID",
codebase = ""
2016-03-07 15:11:29,493 | DEBUG | 127.0.0.1:4] | loader 
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: name = "java.rmi.dgc.Lease",
codebase = ""
2016-03-07 15:11:29,493 | DEBUG | 127.0.0.1:4] | loader 
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: name = "java.rmi.dgc.VMID",
codebase = ""
2016-03-07 15:11:29,493 | DEBUG | 127.0.0.1:4] | loader 
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: name = "[B", codebase = ""
2016-03-07 15:11:29,493 | DEBUG | 127.0.0.1:4] | loader 
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: name = "java.rmi.server.UID",
codebase = ""
2016-03-07 15:11:29,494 | DEBUG | 127.0.0.1:4] | ref
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: free connection (reuse = true)
2016-03-07 15:11:29,494 | DEBUG | 127.0.0.1:4] | tcp
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: reuse connection
2016-03-07 15:11:29,494 | DEBUG | 127.0.0.1:4] | tcp
 
|  -  -  | RMI RenewClean-[127.0.0.1:4]: create reaper
2016-03-07 15:11:35,350 | DEBUG | nsole user karaf |
LoggingCommandSessionListener| 44 - org.apache.karaf.shell.core - 4.0.4
| Command: 'feature:install camel-websocket' failed:
java.lang.InterruptedException



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-websocket-installation-hangs-tp5778701.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Polling http endpoints

2016-03-07 Thread Quinn Stevenson
Sorry - I forgot that the loop DSL doesn’t take a predicate.

How about this - configure redelivery handling on your main route, and then 
have the direct route throw an exception if the payload isn’t ready.

Here’s a mocked example:
public class MyRouteBuilder extends RouteBuilder {
Processor responseProcessor = new ResponseProcessor();

public void configure() {
onException(MyException.class)
.logRetryAttempted(true)
.retryAttemptedLogLevel(LoggingLevel.INFO)
.redeliveryDelay(2000)

.retryWhile(exchangeProperty(ResponseProcessor.RESPONSE_PROPERTY).isNotEqualTo(true))
;

fromF("timer://%s?period=%d", "my-timer", 5000)
.log("Waiting for processor")
.to( "direct://wait-for-response")
.to("mock://complete")
;

from("direct://wait-for-response")
.errorHandler(noErrorHandler())
.log( "looking for response")
.process(responseProcessor)
.choice()
.when( 
exchangeProperty(ResponseProcessor.RESPONSE_PROPERTY).isNotEqualTo( true ) )
.throwException( MyException.class, "Not Ready" )
.otherwise()
.end()
;
}

}
My simple processor just sets an exchange property - nothing fancy but 
hopefully it illustrates what I’m suggesting.

> On Mar 6, 2016, at 6:18 AM, jelmer  wrote:
> 
> It does not look like loop takes a predicate, it expects the expression to
> be a number, which i think makes it unsuited for this sort of thing.
> 
> I would this expect this to be a fairly common case, i am surprised its
> this difficult to figure out how to do this
> 
> On 4 March 2016 at 16:25, Quinn Stevenson 
> wrote:
> 
>> The “direct:await-import-complete” calling itself makes me a little
>> nervous - the call stack could get pretty deep if it has to wait very long.
>> 
>> Could you use the loop DSL (http://camel.apache.org/loop.html <
>> http://camel.apache.org/loop.html>)?
>> 
>> 
>>> On Mar 3, 2016, at 11:44 AM, jelmer  wrote:
>>> 
>>> Since no one answered I came up with this :
>>> 
>>>   from("file:/Users/jkuperus/foo")
>>> .process(ToMultiPartRequestProcessor)
>>> .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.POST))
>>> .setHeader(Exchange.CONTENT_TYPE, constant("multipart/form-data"))
>>> .setHeader(Exchange.HTTP_PATH, constant("/api/tasks"))
>>> .to("http4://localhost:11380")
>>> .transform().header("Content-Location")
>>> .to("direct:await-import-complete")
>>> 
>>> 
>>>   from("direct:await-import-complete")
>>> .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
>>> .setHeader(Exchange.HTTP_PATH, body().convertToString())
>>> .to("http4://localhost:11380")
>>> .transform(body().convertToString())
>>> .choice()
>>>   .when().jsonpath("[?(@.state == 'completed')]")
>>> .transform().jsonpath("@.campaignId")
>>> .to("direct:do-stuff")
>>>   .otherwise()
>>> .log("Task was not yet completed retrying in 2 seconds")
>>> .delay(2000)
>>> .transform().header(Exchange.HTTP_PATH)
>>> .to("direct:await-import-complete")
>>> 
>>> 
>>> Does this make any sense ?
>>> 
>>> On 2 March 2016 at 21:27, jelmer  wrote:
>>> 
 Hi as part of a camel route i upload a file to a REST service, the
>> service
 will return status 202 and a Content-Location header that points to a
>> json
 resource with a status field
 i want to wait for the status of this resource to change to completed,
>> and
 only then continue. so i need some sort of polling
 But i don't see an obvious way to do this in camel
 can anyone offer any suggestions?
 
>> 
>> 



RE: About Stream Caching

2016-03-07 Thread Goyal, Arpit
Hi Matt,

That was my initial gut feeling. Do you have any additional details of how to 
handle such use cases? 

Are they dependent on the container in which Camel is running and for Reliable 
Delivery of message we have to build DB/In-memory repositories?

Regards,
Arpit.

-Original Message-
From: Matt Sicker [mailto:boa...@gmail.com] 
Sent: Sunday, March 6, 2016 9:52 AM
To: users@camel.apache.org
Subject: Re: About Stream Caching

Stream caching is for when the body of a message is a stream and you want
to read from it multiple times (e.g., to log the body or run multiple
expressions against it). I don't think it applies to either scenario.

On 5 March 2016 at 13:41, Goyal, Arpit  wrote:

> Was reading about the http://camel.apache.org/stream-caching.html
> functionality of Camel and would like to know would this also helps in
> following use-cases:
>
>
> -  There are like 1 Million (less than 5kb) messages following in
> short duration (like 1-10 minutes)?
>
> -  Reliable delivery of message.
>
> In case this is not the right approach, could someone share approach to
> achieve both? Any pointers would be great.
>
> Regards,
> Arpit.
>



-- 
Matt Sicker 


3rd Message getting stuck as an inflight message

2016-03-07 Thread abhijit.kulkarni
Hello, 

I am using Apache Camel 2.15.0 and Spring DSL. 
I have a route which starts automatically as a restlet. see below the
outline of the route - 

 
  

    Accepts a JSON Message and perfroms various activities


   

   http://camel.465427.n5.nabble.com/3rd-Message-getting-stuck-as-an-inflight-message-tp5778705.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: About Stream Caching

2016-03-07 Thread Matt Sicker
Well, for the rapid burst of messages, I'd probably work on tuning how many
concurrent consumers are used for that endpoint. If you need to transfer
them really fast for further processing, you could use the seda component
or camel-disruptor if you want to use a 3rd party library with it.

For the reliable messaging, I'd stick to a message broker if possible like
ActiveMQ. Unless you mean the SOAP feature in which case CXF supports that
(reliable messaging).

On 7 March 2016 at 09:33, Goyal, Arpit  wrote:

> Hi Matt,
>
> That was my initial gut feeling. Do you have any additional details of how
> to handle such use cases?
>
> Are they dependent on the container in which Camel is running and for
> Reliable Delivery of message we have to build DB/In-memory repositories?
>
> Regards,
> Arpit.
>
> -Original Message-
> From: Matt Sicker [mailto:boa...@gmail.com]
> Sent: Sunday, March 6, 2016 9:52 AM
> To: users@camel.apache.org
> Subject: Re: About Stream Caching
>
> Stream caching is for when the body of a message is a stream and you want
> to read from it multiple times (e.g., to log the body or run multiple
> expressions against it). I don't think it applies to either scenario.
>
> On 5 March 2016 at 13:41, Goyal, Arpit  wrote:
>
> > Was reading about the http://camel.apache.org/stream-caching.html
> > functionality of Camel and would like to know would this also helps in
> > following use-cases:
> >
> >
> > -  There are like 1 Million (less than 5kb) messages following in
> > short duration (like 1-10 minutes)?
> >
> > -  Reliable delivery of message.
> >
> > In case this is not the right approach, could someone share approach to
> > achieve both? Any pointers would be great.
> >
> > Regards,
> > Arpit.
> >
>
>
>
> --
> Matt Sicker 
>



-- 
Matt Sicker 


swagger exclude OPTIONS route in UI

2016-03-07 Thread camel_case
Swagger insists on creating an OPTIONS route which it automatically tests
before running a POST.  Is there a way to have OPTIONS then not appear in
the swagger UI?



--
View this message in context: 
http://camel.465427.n5.nabble.com/swagger-exclude-OPTIONS-route-in-UI-tp5778714.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel Spring-Ws -> MTOM Attachments

2016-03-07 Thread bwest
Greetings, 

I'm trying to figure out how to make a call to a SOAP web service via the
camel spring-ws component.  This webservice returns an attachment that is a
pdf, ideally i'd like to retrieve that response and write the pdf to disk. 
However I'm struggling trying to find a method to retrieve the attachment
properly.  All I get on the exchange is an DataHandler object, with a
byte[0] data source.  In my research around the internet these seems to be a
common issue, but I've yet to find a good solution to it.  Does anybody have
and suggestions or methods that would achieve the above?  

Any help or suggestions are very appreciated. 

Thank you.
  



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Spring-Ws-MTOM-Attachments-tp5778718.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel jetty Dead Lock and Threadfull based ServiceMix 5.3.0

2016-03-07 Thread sjlee7373
Hi, 

I have a problem with camel in ServiceMix.

I made webservice throught camel-jetty, camel-recipentlist in servicemix.
This package is good performance but resource lock and thread full ocurred
it. This system process 40 Call per second.

The problem is that pool threads aren't released properly sometimes. After 
a few hours following the start of an application I can see using jstack 
tool that some threads are stuck in a WAITING state: 

configuration is as follows: 
- servicemix 5.3.0
- camel 2.13.2
- using component (camel-jetty , camel-recipentlist  based Spring DSL)

-- SOURCE
--



 
jetty://http://api.host.lm?x=${header.x}&y=${header.y}






http://resultMap?httpClient.soTimeout=8"/>


-- LOG
---
ps -eLf  | wc -l --> 32500

"CamelJettyClient(0x3d0b240d)-26916" damen prio=10 tid=0x0ff69800
nid =0x10ef wating on condition [0x2b4b3ba3f]
   java.lang.Thread.State: TIMED_WAITNG(parking)
 at sun.misc.Unsafe.park(Native Method)
 - parging to wati for <0x6f13f19b0> (a
java.util.concurrent.locks.AbstractQueuedsynchronizer$ConditionObject)
 at java.util.concurrent.locks.LocsSupport.parkNanos(LockSupport,java:226)
 at
org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:342)
 at
org.eclipse.jetty.util.thread.QueuedThreadPool.idleJobPoss(QueuedThreadPool.java:526)
 at
org.eclipse.jetty.tuil.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
 atjava.lnag.thread.run(Thread.java:745)

Above log more than 3line.. 

Can you suggest what else can be checked? Am I missing something? Or may be 
this is a bug in Camel? 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-jetty-Dead-Lock-and-Threadfull-based-ServiceMix-5-3-0-tp5778717.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Need to consume multiple SOAP and REST webservices and expose result as SOAP as well as REST endpoint

2016-03-07 Thread amitmahesh

We need to fetch data from 3 SOAP webservices and 2 REST services in a
sequential manner, process the data and expose the Result as both SOAP and
REST webservices to be consumed by end user. What should be the best
approach to implement this. Can we avoid SOAP/REST to POJO marshalling. that
will give good performance. Also the SOAP services which we will consume
doesnt have WSDL since they are written in COBOL, but we have their endpoint
URLS and input /output format. Pls suggest the best approach to implement
this since we have been struggling a lot with namespace conflicts and
binding errors.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-to-consume-multiple-SOAP-and-REST-webservices-and-expose-result-as-SOAP-as-well-as-REST-endpoint-tp5778719.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel jetty Dead Lock and Threadfull based ServiceMix 5.3.0

2016-03-07 Thread Claus Ibsen
On Tue, Mar 8, 2016 at 2:15 AM, sjlee7373  wrote:
> Hi,
>
> I have a problem with camel in ServiceMix.
>
> I made webservice throught camel-jetty, camel-recipentlist in servicemix.
> This package is good performance but resource lock and thread full ocurred
> it. This system process 40 Call per second.
>
> The problem is that pool threads aren't released properly sometimes. After
> a few hours following the start of an application I can see using jstack
> tool that some threads are stuck in a WAITING state:
>
> configuration is as follows:
> - servicemix 5.3.0
> - camel 2.13.2
> - using component (camel-jetty , camel-recipentlist  based Spring DSL)
>
> -- SOURCE
> --
> 
> 
> 
>
> jetty://http://api.host.lm?x=${header.x}&y=${header.y}
> 

Dont use a recipient list when you send the message to the *same*
host. Instead set a header with the Exchange.HTTP_QUERY and send the
message to a regular . Then only 1 endpoint is in use and that
reduces the memory/thread and whatnot.




> 
> 
> 
>
> 
> http://resultMap?httpClient.soTimeout=8"/>
> 
>
> -- LOG
> ---
> ps -eLf  | wc -l --> 32500
>
> "CamelJettyClient(0x3d0b240d)-26916" damen prio=10 tid=0x0ff69800
> nid =0x10ef wating on condition [0x2b4b3ba3f]
>java.lang.Thread.State: TIMED_WAITNG(parking)
>  at sun.misc.Unsafe.park(Native Method)
>  - parging to wati for <0x6f13f19b0> (a
> java.util.concurrent.locks.AbstractQueuedsynchronizer$ConditionObject)
>  at java.util.concurrent.locks.LocsSupport.parkNanos(LockSupport,java:226)
>  at
> org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:342)
>  at
> org.eclipse.jetty.util.thread.QueuedThreadPool.idleJobPoss(QueuedThreadPool.java:526)
>  at
> org.eclipse.jetty.tuil.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>  atjava.lnag.thread.run(Thread.java:745)
>
> Above log more than 3line..
>
> Can you suggest what else can be checked? Am I missing something? Or may be
> this is a bug in Camel?
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-jetty-Dead-Lock-and-Threadfull-based-ServiceMix-5-3-0-tp5778717.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: swagger exclude OPTIONS route in UI

2016-03-07 Thread Claus Ibsen
Hi

I dont think people understand your question, can you try to explain this more

On Mon, Mar 7, 2016 at 11:15 PM, camel_case  wrote:
> Swagger insists on creating an OPTIONS route which it automatically tests
> before running a POST.  Is there a way to have OPTIONS then not appear in
> the swagger UI?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/swagger-exclude-OPTIONS-route-in-UI-tp5778714.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: CAMEL 2.16.2 and Swagger

2016-03-07 Thread Claus Ibsen
Can you upgrade the swagger-java library as there is a bug in it
afaik. There is a newer 1.5.7 release.

On Fri, Mar 4, 2016 at 5:40 PM, Gerald Mixa  wrote:
> Hi,
>
> i have just tried out the camel swagger plugin example which is shipped
> with 2.16.
> So far it seems to work. But when i go to the use case which is offered
> by http://localhost/#!/user/get_user_id
> to retrieve specific info for a user who is ghiven by its id swagger just
> offers a selection box to insert some id.
> Unfortunately the selection box is empty and contains no values. This
> behavior is present on google chrome and firefox. I did not manage to
> figure out how to change this behaviour. I would like to be able to enter a
> random Value for the USER id so i count request an arbitrary user info.
> Doese someone else have the same issues ?
>
> Greetings
>
> Gerald



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Polling http endpoints

2016-03-07 Thread Claus Ibsen
On Mon, Mar 7, 2016 at 4:23 PM, Quinn Stevenson
 wrote:
> Sorry - I forgot that the loop DSL doesn’t take a predicate.
>

Yeah its been talked about from time to time about this need.

I have logged a ticket
https://issues.apache.org/jira/browse/CAMEL-9675

> How about this - configure redelivery handling on your main route, and then 
> have the direct route throw an exception if the payload isn’t ready.
>
> Here’s a mocked example:
> public class MyRouteBuilder extends RouteBuilder {
> Processor responseProcessor = new ResponseProcessor();
>
> public void configure() {
> onException(MyException.class)
> .logRetryAttempted(true)
> .retryAttemptedLogLevel(LoggingLevel.INFO)
> .redeliveryDelay(2000)
> 
> .retryWhile(exchangeProperty(ResponseProcessor.RESPONSE_PROPERTY).isNotEqualTo(true))
> ;
>
> fromF("timer://%s?period=%d", "my-timer", 5000)
> .log("Waiting for processor")
> .to( "direct://wait-for-response")
> .to("mock://complete")
> ;
>
> from("direct://wait-for-response")
> .errorHandler(noErrorHandler())
> .log( "looking for response")
> .process(responseProcessor)
> .choice()
> .when( 
> exchangeProperty(ResponseProcessor.RESPONSE_PROPERTY).isNotEqualTo( true ) )
> .throwException( MyException.class, "Not Ready" )
> .otherwise()
> .end()
> ;
> }
>
> }
> My simple processor just sets an exchange property - nothing fancy but 
> hopefully it illustrates what I’m suggesting.
>
>> On Mar 6, 2016, at 6:18 AM, jelmer  wrote:
>>
>> It does not look like loop takes a predicate, it expects the expression to
>> be a number, which i think makes it unsuited for this sort of thing.
>>
>> I would this expect this to be a fairly common case, i am surprised its
>> this difficult to figure out how to do this
>>
>> On 4 March 2016 at 16:25, Quinn Stevenson 
>> wrote:
>>
>>> The “direct:await-import-complete” calling itself makes me a little
>>> nervous - the call stack could get pretty deep if it has to wait very long.
>>>
>>> Could you use the loop DSL (http://camel.apache.org/loop.html <
>>> http://camel.apache.org/loop.html>)?
>>>
>>>
 On Mar 3, 2016, at 11:44 AM, jelmer  wrote:

 Since no one answered I came up with this :

   from("file:/Users/jkuperus/foo")
 .process(ToMultiPartRequestProcessor)
 .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.POST))
 .setHeader(Exchange.CONTENT_TYPE, constant("multipart/form-data"))
 .setHeader(Exchange.HTTP_PATH, constant("/api/tasks"))
 .to("http4://localhost:11380")
 .transform().header("Content-Location")
 .to("direct:await-import-complete")


   from("direct:await-import-complete")
 .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
 .setHeader(Exchange.HTTP_PATH, body().convertToString())
 .to("http4://localhost:11380")
 .transform(body().convertToString())
 .choice()
   .when().jsonpath("[?(@.state == 'completed')]")
 .transform().jsonpath("@.campaignId")
 .to("direct:do-stuff")
   .otherwise()
 .log("Task was not yet completed retrying in 2 seconds")
 .delay(2000)
 .transform().header(Exchange.HTTP_PATH)
 .to("direct:await-import-complete")


 Does this make any sense ?

 On 2 March 2016 at 21:27, jelmer  wrote:

> Hi as part of a camel route i upload a file to a REST service, the
>>> service
> will return status 202 and a Content-Location header that points to a
>>> json
> resource with a status field
> i want to wait for the status of this resource to change to completed,
>>> and
> only then continue. so i need some sort of polling
> But i don't see an obvious way to do this in camel
> can anyone offer any suggestions?
>
>>>
>>>
>



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: How to throw an exception from camel route

2016-03-07 Thread Claus Ibsen
There is a  you can use from Spring DSL.

On Thu, Mar 3, 2016 at 3:43 PM, ravivadgaonkar
 wrote:
> I am calling a camel route from java class using a proxy.
> I wanted the camel route to throw an exception on certain condition (in my
> case when it hits 404 response).
> The java class needs to be capable for catching this exception and and
> process further.
>
> Please let me know how to achieve this. I am using spring DSL for the same.
>
> Thanks.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-throw-an-exception-from-camel-route-tp5778549.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Using apache camel failover loadbalancer

2016-03-07 Thread Claus Ibsen
Hi

Study the examples here
http://camel.apache.org/load-balancer.html

On Thu, Mar 3, 2016 at 7:44 AM, mnl  wrote:
> I am new to camel and trying to use failover loadbalancer. I have list of
> endpoints (say, A, B, C) which can be used to send message such that if one
> fails the endpoint next in the list can be tried. lets say B was success.
> After successful send, B will receive an exchange which can be used to know
> the status of the message sent earlier.
> I have tried various versions for loadbalancer as:
>
> Case-1
>
> from(fromEndpoint)
> .errorHandler(defaultErrorHandler)
> .loadbalance().failover()
> .to(smppEndpointList)
> .process(getSendProcessor);
>
>> This fails to use the processor returned by the getSendProcessor() and
>> overall the flow fails.
>
> Now I change the above version to this.
>
> Case-2
>
> from(fromEndpoint)
> .errorHandler(defaultErrorHandler)
> .to(smppEndpointList)
> .process(getSendProcessor)
> .loadbalance().failover();
>
>> Here if the smppEndpointList has only one endpoint then the call is
>> successful but in case of multiple endpints in the list it fails. Also
>> from further debugging I found that the processor returned by
>> getSendProcessor is not used over here
>
> Case-3
>
> from(fromEndpoint)
> .errorHandler(defaultErrorHandler)
> .process(getSendProcessor)
> .loadbalance().failover()
> .to(smppEndpointList);
>
>> This also fails as the processor returned by getSendProcessor is not used.
>
> Can some one please suggest the correct implementation. I am stuck over this
> for long.
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Using-apache-camel-failover-loadbalancer-tp5778537.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2