Dave
Dave

Reputation: 19220

Does Apache Camel replace or complement creating micro-services with Spring Boot?

I have been working for a while with Spring micro-services and have no come across Apache Camel as a tool for building micro-services. I'm unclear -- is Apache Camel a replacement for creating micro-sevices with Spring Boot or does it add functionality / short-cuts to developing such services with Spring Boot? It's already fairly simple to create microservices with Spring Boot so it's hard to imagine what Apache Camel would add but that is the essence of my question.

Upvotes: 2

Views: 985

Answers (3)

Simon Martinelli
Simon Martinelli

Reputation: 36203

Apache Camel has nothing to do with microservices.

It's an implementation of the Enterprise Integration Patterns: https://www.enterpriseintegrationpatterns.com/

Apache Camel provides an implementation for most of the patterns from the book from Gregor Hohpe and Bobby Woolf. Plus a variety of inbound and outbound endpoints to integrate with systems like the file system, FTP, HTTP, Messaging, Facebook etc.

Find more information on the website: https://camel.apache.org/

There is a Spring Boot Starter project to run Camel in a Spring Boot application: https://camel.apache.org/camel-spring-boot/4.0.x/index.html

Upvotes: 2

VarunKrish
VarunKrish

Reputation: 179

Spring Boot is a framework which simplifies application packing and startup while Spring is the actual framework which has libraries for performing various tasks. Technically, we can use Camel for building micro-services as well and many aspects of camel depend on Spring. If you foresee many integration related functionality like sending email or communicating with other system, you can use also use Hexagonal architecture.

Upvotes: 0

Nikhil Silveira
Nikhil Silveira

Reputation: 554

what Apache Camel would add, that is the essence of my question

In service of declaring REST based microservices, Camel's REST DSL provides a fluent API for declaring microservices. Take for example:

rest("/books").produces("application/json")
    .get().outType(Book[].class)
        .to("bean:bookService?method=getBooks(${header.bookCategory})")

Should tell you at a glance that requests to the path /books will get you a List of Book, as long as you send a request parameter named bookCategory. This is mapped to a POJO bean called bookService.

Upvotes: 2

Related Questions