How to add a camel process in moqui

I am not very familiar with camel. After analyzing the moqui-camel example, I hope there is an example of building MoquiServiceConsumer as a reference.
The current example generates a producerTemplate through the sd.location pointed to by the camel type in the call service, and calls requestBodyAndHeaders to return the executed TargetCamelExample.
My real question is how to use this moqui component to complete a typical camel function, such as listening to receive a file directory, filtering out files with a csv suffix, making some supplements to the content, and then importing it to the target service.

1 Like

Apache Camel is sort of a message-based scripting tool, or in terms of fitting it into a context you can think of it as calling an async script by sending a message (from a producer) and receiving a response (from a consumer). Any Camel endpoint that can produce or consume certain messages can be configured along with other camel tool, so the Moqui integration with Apache Camel just provides consumer and producer interfaces to the Service Facade.

1 Like

I’m also a bit surprised that moqui-camel provides these interfaces for the purpose of being a camel component? So that it can be called directly in routes in a standalone camel program?

If you think of moqui as a backend service, wouldn’t it achieve the same effect by making it available for camel calls via the RestFul interface? So what is the purpose of moqui-camel?

1 Like

I am also looking at this camel interface and have problems getting started.
Is it possible to have an example reading from the moqui rest interface a query through Camel?

Thanks in advance,
Hans

please find my attempt to create a REST call using the camel component:

comments very welcome!

It seem that the camel integration is pretty difficult to create because, in general, camel needs java17 what is not available in Moqui, and there seem not to be not much interest upgrading.

So i abandon this Camel integration attempt and go now for a separate system using Quarkus/Camel where a number of examples are available here and even a workshop about the subject here
communication with Moqui can be over REST because Moqui has a nice client builtin.

As a side comment, it could be an Idea that Moqui could be migrated as an extension of Quarkus as a lot of java systems already have, like Camel, Kafka, RabitMq and others More info about Quarkus here

Using the restclient with Quarkus gave a problem, fixed with pull request: fix: Unable to release Session : Caused by: java.io.NotSerializableEx… by hansbak · Pull Request #647 · moqui/moqui-framework · GitHub