serviceCall: must be configured before it can be used

2016-10-18 Thread ValeryN
Hello,

I'm trying to use serviceCall (introduced in 2.18 version) from Spring Boot
app, consul as a service discovery tool.

Here is an example:
from("direct:test")
.serviceCall("config-api")
.log("${body}");


Both app and target service are discoverable through consul, RestTemplate
sends REST calls just fine, but when I configure a test apache camel route
it gives me :

Caused by: java.lang.IllegalStateException: The ServiceCall:
ServiceCall[config-api] must be configured before it can be used.
at
org.apache.camel.impl.remote.DefaultServiceCallProcessorFactory.createProcessor(DefaultServiceCallProcessorFactory.java:84)
~[camel-core-2.18.0.jar:2.18.0]
at
org.apache.camel.impl.remote.DefaultServiceCallProcessorFactory.createProcessor(DefaultServiceCallProcessorFactory.java:51)
~[camel-core-2.18.0.jar:2.18.0]
at
org.apache.camel.impl.DefaultProcessorFactory.createProcessor(DefaultProcessorFactory.java:69)
~[camel-core-2.18.0.jar:2.18.0]
at
org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:535)
~[camel-core-2.18.0.jar:2.18.0]
at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
~[camel-core-2.18.0.jar:2.18.0]
at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:221)
~[camel-core-2.18.0.jar:2.18.0]
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1068)
~[camel-core-2.18.0.jar:2.18.0]

Couldn't find anything regarding any extra configuration on the EIP page:
http://camel.apache.org/servicecall-eip.html

My camel dependencies are:

compile group: 'org.apache.camel', name: 'camel-stream', version:
"${apacheCamelVersion}"
compile group: 'org.apache.camel', name: 'camel-http', version:
"${apacheCamelVersion}"
compile group: 'org.apache.camel', name: 'camel-consul', version:
"${apacheCamelVersion}"

compile group: 'org.apache.camel', name: 'camel-xmljson', version:
"${apacheCamelVersion}"
compile group: 'xom', name: 'xom', version: '1.2.5'





--
View this message in context: 
http://camel.465427.n5.nabble.com/serviceCall-must-be-configured-before-it-can-be-used-tp5788922.html
Sent from the Camel - Users mailing list archive at Nabble.com.


serviceCall with exchangeProperty in URI

2016-10-18 Thread ValeryN
Hello,

Could you please give an example how to use a new serviceCall with dynamic
URI parameter?
Ideally from ${exchangeProperty.MY_PROPERTY}

Wanna do something like that -
serviceCall("http://my-service/api/v1/service?clientId=${exchangeProperty.clientId};)
Using serviceCall because it supports Consul service discovery

Thank you!

Val



--
View this message in context: 
http://camel.465427.n5.nabble.com/serviceCall-with-exchangeProperty-in-URI-tp5788921.html
Sent from the Camel - Users mailing list archive at Nabble.com.


HTTP keeps retrying after maximumRedeliveries set

2016-10-12 Thread ValeryN
Hello,
 
Could you please advise why automatic retries happen even if I set
maximumRedeliveries to 0? Basically I just want to disable retries.
 
And also, how do I print HTTP response body in case it’s an error code?
${exception} only has a short description that HTTP call to my URL failed
with error code. Server returns details in HTTP response.
 
onException(Exception.class)
.maximumRedeliveries(0);
 
from("direct:send")
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
.to("http://localhost:8100/;)
.log("${body}");
 
In 3 different cases (URL is not available, server code 400 or 500) I get
numerous retries before it finally stop:
 
2016-10-12 13:11:57.397  INFO 58522 --- [] route2   
   
: HTTP operation failed invoking http://localhost:8100/ with statusCode: 400
2016-10-12 13:11:57.397  INFO 58522 --- [] route2   
   
: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation
failed invoking http://localhost:8100/ with statusCode: 400
2016-10-12 13:11:57.399 ERROR 58522 --- []
o.a.camel.processor.DefaultErrorHandler  : Failed delivery for (MessageId:
ID-raptor-local-64577-1476303106751-0-11 on ExchangeId:
ID-raptor-local-64577-1476303106751-0-12). Exhausted after delivery attempt:
1 caught: org.apache.camel.http.common.HttpOperationFailedException: HTTP
operation failed invoking http://localhost:8100/  with statusCode: 400.
Processed by failure processor:
FatalFallbackErrorHandler[Pipeline[[Channel[Log(route2)[exchangeExceptionMessage]],
Channel[Log(route2)[exchangeException]




--
View this message in context: 
http://camel.465427.n5.nabble.com/HTTP-keeps-retrying-after-maximumRedeliveries-set-tp5788708.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel and Hystrix Command Name

2016-10-11 Thread ValeryN
Thanks!!! It worked

 

From: "Claus Ibsen-2 [via Camel]" <ml-node+s465427n578861...@n5.nabble.com>
Date: Tuesday, October 11, 2016 at 09:40
To: ValeryN <novikov.val...@gmail.com>
Subject: Re: Apache Camel and Hystrix Command Name

 

Hi 

I think we made it use the node id as the command name. So you can try 
doing hystrix().id("myNameHere")  


On Tue, Oct 11, 2016 at 6:19 PM, ValeryN <[hidden email]> wrote: 


> I'm really happy to see hystrix support though DSL in a latest Apache Camel 
> version 2.18.0. My question is - how does one name a hystrix command now? 
> 
> Let's say if I write - 
> 
> from("direct:start").hystrix().to("log:out") 
> Hystrix dashboard will register "hystrix1" command and show stat for it, 
> that's the point I wanna change. 
> 
> Hystrix's  EIP doc <http://camel.apache.org/hystrix-eip.html>   says - 
> "CommandKey - Used to identify the hystrix command. This option cannot be 
> configured but is locked down to be the node id to make the command unique." 
> 
> It's just hard to believe that people will actually use hystrix stat without 
> a meaningful name, so I was thinking maybe I'm missing something. Or is it a 
> feature request? 
> 
> Thank you in advance 
> 
> 
> 
> -- 
> View this message in context: 
> http://camel.465427.n5.nabble.com/Apache-Camel-and-Hystrix-Command-Name-tp5788614.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

If you reply to this email, your message will be added to the discussion below:

http://camel.465427.n5.nabble.com/Apache-Camel-and-Hystrix-Command-Name-tp5788614p5788616.html
 

To unsubscribe from Apache Camel and Hystrix Command Name, click here.
NAML 





--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-and-Hystrix-Command-Name-tp5788614p5788617.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Apache Camel and Hystrix Command Name

2016-10-11 Thread ValeryN
I'm really happy to see hystrix support though DSL in a latest Apache Camel
version 2.18.0. My question is - how does one name a hystrix command now?

Let's say if I write -

from("direct:start").hystrix().to("log:out")
Hystrix dashboard will register "hystrix1" command and show stat for it,
that's the point I wanna change.

Hystrix's  EIP doc    says -
"CommandKey - Used to identify the hystrix command. This option cannot be
configured but is locked down to be the node id to make the command unique."

It's just hard to believe that people will actually use hystrix stat without
a meaningful name, so I was thinking maybe I'm missing something. Or is it a
feature request?

Thank you in advance



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-and-Hystrix-Command-Name-tp5788614.html
Sent from the Camel - Users mailing list archive at Nabble.com.