Hi,
When I was starting to work with camel, I'd really liked to have an
example of a functional app. There are many examples in the official
repos, but there are usually very simple, single routes, not applications.
So I decided now to give it a try and write one myself.
As the task I chose realworld.io demo app (the backend part), which is
not in fact very real worldly, but it's a pretty good specification and
also it's small enough that a single developer can write it as a side
project in limited time.
Also, there are many ready to use frontends, so I could have an UI to
show the app without actually having to write one. :-)
So here it is: https://github.com/jacekszymanski/realworld-camel-springboot
Due to the nature of the project I did not find use for
asynchronous/messaging components like kafka or even seda (I could have
somehow shoehorned them in, but I decided not to; I think I can add them
later, it's in the project README), and have used only 5 stock Camel
components.
Nevertheless, I think I managed to show how it is possible to write/use:
- route configurations: all the access control and error handling (and
more) is done through configurations,
- route templates: most of the routes returning answers to clients are
templated,
- custom components: there are two, one (xjpa) is an ad-hoc extension of
the jpa standard component, it's included in the app source; the other
one (jwt) is written from scratch in a separate repository,
- rests: the entire app has a rest API, although the rests are generated
and to put it all together into a working application.
The example app needs camel 3.20.4 to run. It might run on camel 4, but
I didn't try it. I certainly hope to update it when camel 4 is released.
All that said, it was real fun to code it, while doing it I have learnt
several things about Camel, posted three issues and two pull requests,
now I hope this will be useful to someone else as well and that I'll be
able to contribute more to Camel and the community.
js.