You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jacek szymanski <ja...@gmail.com> on 2023/04/28 09:27:59 UTC

A bigger Camel example

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.


Re: A bigger Camel example

Posted by jacek szymanski <ja...@gmail.com>.
Hi,

thanks for the clarification.

I'll look into this, but I want to PR the JPA enhancement first anyway.

js.

On 4/28/23 15:03, Pasquale Congiusti wrote:
> I think Claus was referring on writing the blog post directly on Camel
> official blog [1]. It's quite straightforward, you can use any previous
> blog post as structure reference, ie [2].
>
> Regards,
> Pasquale.
>
> [1] https://github.com/apache/camel-website
> [2] https://github.com/apache/camel-website/pull/996
>
> On Fri, Apr 28, 2023 at 2:33 PM jacek szymanski <ja...@gmail.com>
> wrote:
>
>> Hi,
>>
>> thanks for your answer.
>>
>> I do also think that these JPA options could be useful in general, so I
>> will JIRA&PR them in the coming weeks.
>>
>> Wrt blog post, I don't have a blog, perhaps I could start one, but I'm
>> afraid it'd end up as yet another single post blog; maybe I'll write
>> something like the project's story and put it in the Github Wiki, so if
>> you like it, it could be reposted on the Camel site.
>>
>> But first the JPA...
>>
>> js.
>>
>>
>> On 4/28/23 12:28, Claus Ibsen wrote:
>>> Hi
>>>
>>> Thank you very much for sharing your big example with the community.
>>> I will take a deeper look later when I get more time.
>>>
>>> At first glance, maybe some of the enhancements you did to JPA component
>>> could
>>> benefit Camel in general. And if so you are welcome to create a JIRA and
>>> work on contributing the code changes (PR preferred).
>>>
>>> Also if you have the energy you could consider writing a blog post about
>>> this example and your work,
>>> and we could also have the blog posted on the Camel website (we have
>> guest
>>> authors post blog from time to time).
>>>
>>>
>>>
>>> On Fri, Apr 28, 2023 at 11:28 AM jacek szymanski <
>>> jacek.p.szymanski@gmail.com> wrote:
>>>
>>>> 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.
>>>>
>>>>
>>


Re: A bigger Camel example

Posted by Pasquale Congiusti <pa...@gmail.com>.
I think Claus was referring on writing the blog post directly on Camel
official blog [1]. It's quite straightforward, you can use any previous
blog post as structure reference, ie [2].

Regards,
Pasquale.

[1] https://github.com/apache/camel-website
[2] https://github.com/apache/camel-website/pull/996

On Fri, Apr 28, 2023 at 2:33 PM jacek szymanski <ja...@gmail.com>
wrote:

> Hi,
>
> thanks for your answer.
>
> I do also think that these JPA options could be useful in general, so I
> will JIRA&PR them in the coming weeks.
>
> Wrt blog post, I don't have a blog, perhaps I could start one, but I'm
> afraid it'd end up as yet another single post blog; maybe I'll write
> something like the project's story and put it in the Github Wiki, so if
> you like it, it could be reposted on the Camel site.
>
> But first the JPA...
>
> js.
>
>
> On 4/28/23 12:28, Claus Ibsen wrote:
> > Hi
> >
> > Thank you very much for sharing your big example with the community.
> > I will take a deeper look later when I get more time.
> >
> > At first glance, maybe some of the enhancements you did to JPA component
> > could
> > benefit Camel in general. And if so you are welcome to create a JIRA and
> > work on contributing the code changes (PR preferred).
> >
> > Also if you have the energy you could consider writing a blog post about
> > this example and your work,
> > and we could also have the blog posted on the Camel website (we have
> guest
> > authors post blog from time to time).
> >
> >
> >
> > On Fri, Apr 28, 2023 at 11:28 AM jacek szymanski <
> > jacek.p.szymanski@gmail.com> wrote:
> >
> >> 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.
> >>
> >>
>
>

Re: A bigger Camel example

Posted by jacek szymanski <ja...@gmail.com>.
Hi,

thanks for your answer.

I do also think that these JPA options could be useful in general, so I 
will JIRA&PR them in the coming weeks.

Wrt blog post, I don't have a blog, perhaps I could start one, but I'm 
afraid it'd end up as yet another single post blog; maybe I'll write 
something like the project's story and put it in the Github Wiki, so if 
you like it, it could be reposted on the Camel site.

But first the JPA...

js.


On 4/28/23 12:28, Claus Ibsen wrote:
> Hi
>
> Thank you very much for sharing your big example with the community.
> I will take a deeper look later when I get more time.
>
> At first glance, maybe some of the enhancements you did to JPA component
> could
> benefit Camel in general. And if so you are welcome to create a JIRA and
> work on contributing the code changes (PR preferred).
>
> Also if you have the energy you could consider writing a blog post about
> this example and your work,
> and we could also have the blog posted on the Camel website (we have guest
> authors post blog from time to time).
>
>
>
> On Fri, Apr 28, 2023 at 11:28 AM jacek szymanski <
> jacek.p.szymanski@gmail.com> wrote:
>
>> 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.
>>
>>


Re: A bigger Camel example

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thank you very much for sharing your big example with the community.
I will take a deeper look later when I get more time.

At first glance, maybe some of the enhancements you did to JPA component
could
benefit Camel in general. And if so you are welcome to create a JIRA and
work on contributing the code changes (PR preferred).

Also if you have the energy you could consider writing a blog post about
this example and your work,
and we could also have the blog posted on the Camel website (we have guest
authors post blog from time to time).



On Fri, Apr 28, 2023 at 11:28 AM jacek szymanski <
jacek.p.szymanski@gmail.com> wrote:

> 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.
>
>

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