Discussion:
can Eureka be used as service registry/discovery tool with Apache camel?
Ranabroto Ghosh
2018-08-17 12:41:09 UTC
Permalink
I want two simple camel micro-service application and they communicating
using Eureka service discovery, is this possible? I found couple of
examples camel using Consul but nowhere with Eureka. I would very thankful
if anybody can help with a sample code example.
--
Kind Regards
Rana
Simon Martinelli, 72 Services LLC
2018-08-17 12:46:43 UTC
Permalink
How do you run Camel?
If you use Spring Boot you just have to add @EnableDiscoveryClient and configure the server name/port



-----Original Message-----
From: Ranabroto Ghosh <***@globalcharge.com>
Sent: Freitag, 17. August 2018 14:41
To: ***@camel.apache.org
Subject: can Eureka be used as service registry/discovery tool with Apache camel?

I want two simple camel micro-service application and they communicating using Eureka service discovery, is this possible? I found couple of examples camel using Consul but nowhere with Eureka. I would very thankful if anybody can help with a sample code ex
Ranabroto Ghosh
2018-08-17 13:18:48 UTC
Permalink
I wanted something like below,

<serviceCall name="testService/getDetails?id=3D45"/>


Can camel not use some component to discover the service URL from eureka
for this service?

On 17 August 2018 at 13:41, Ranabroto Ghosh <
Post by Ranabroto Ghosh
I want two simple camel micro-service application and they communicating
using Eureka service discovery, is this possible? I found couple of
examples camel using Consul but nowhere with Eureka. I would very thankful
if anybody can help with a sample code example.
--
Kind Regards
Rana
--
Kind Regards
Rana
Luca Burgazzoli
2018-08-17 13:29:49 UTC
Permalink
Yes it is possible if you use spring-boot +
spring-cloud-eureka-discovery + camel-spring-cloud.
i.e. in camel-example-spring-cloud-servicecall we use consul but if
you swap consul by eureka, it should work too as camle uses the
generic DiscoveryClient implementation provided by spring-cloud.

If it does not work, please raise a jira.

---
Luca Burgazzoli

On Fri, Aug 17, 2018 at 3:19 PM Ranabroto Ghosh
Post by Ranabroto Ghosh
I wanted something like below,
<serviceCall name="testService/getDetails?id=3D45"/>
Can camel not use some component to discover the service URL from eureka
for this service?
On 17 August 2018 at 13:41, Ranabroto Ghosh <
Post by Ranabroto Ghosh
I want two simple camel micro-service application and they communicating
using Eureka service discovery, is this possible? I found couple of
examples camel using Consul but nowhere with Eureka. I would very thankful
if anybody can help with a sample code example.
--
Kind Regards
Rana
--
Kind Regards
Rana
Ranabroto Ghosh
2018-08-20 14:03:13 UTC
Permalink
Thank you @Iburgazzoli, I tried as you said and its working.


Caller Microservice pom.xml, i just pasted related part

<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-cloud-starter</artifactId>
<version>${camel.version}</version>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http4</artifactId>
<version>${camel.version}</version>
</dependency>
</dependencies>


Caller Camel route:
<route id="first-route-microservice" autoStartup="true">
<from uri="direct:test"/>
<log message="ROUTE 'direct:test' CALLED"/>
<to uri="bean:testRoute?method=test"/>
<serviceCall name="camel-microservices-2/api/hey/123"/>
<log message="Done ${body}"/>
</route>




On 17 August 2018 at 14:30, lburgazzoli [via Camel] <
Post by Luca Burgazzoli
Yes it is possible if you use spring-boot +
spring-cloud-eureka-discovery + camel-spring-cloud.
i.e. in camel-example-spring-cloud-servicecall we use consul but if
you swap consul by eureka, it should work too as camle uses the
generic DiscoveryClient implementation provided by spring-cloud.
If it does not work, please raise a jira.
---
Luca Burgazzoli
On Fri, Aug 17, 2018 at 3:19 PM Ranabroto Ghosh
<[hidden email] <http:///user/SendEmail.jtp?type=node&node=5822314&i=0>>
Post by Ranabroto Ghosh
I wanted something like below,
<serviceCall name="testService/getDetails?id=3D45"/>
Can camel not use some component to discover the service URL from eureka
for this service?
On 17 August 2018 at 13:41, Ranabroto Ghosh <
[hidden email] <http:///user/SendEmail.jtp?type=node&node=5822314&i=1>>
Post by Ranabroto Ghosh
I want two simple camel micro-service application and they
communicating
Post by Ranabroto Ghosh
Post by Ranabroto Ghosh
using Eureka service discovery, is this possible? I found couple of
examples camel using Consul but nowhere with Eureka. I would very
thankful
Post by Ranabroto Ghosh
Post by Ranabroto Ghosh
if anybody can help with a sample code example.
--
Kind Regards
Rana
--
Kind Regards
Rana
------------------------------
If you reply to this email, your message will be added to the discussion
http://camel.465427.n5.nabble.com/RE-can-Eureka-be-used-as-s
ervice-registry-discovery-tool-with-Apache-camel-tp5822311p5822314.html
To unsubscribe from Camel, click here
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465427&code=cmFuYWJyb3RvLmdob3NoQGdsb2JhbGNoYXJnZS5jb218NDY1NDI3fC0xNDE1NjM5OTY5>
.
NAML
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
Kind Regards
Rana
Loading...