Re: loading routes from external xml files

2023-07-31 Thread Claus Ibsen
Hi

You can use org.apache.camel.support.PluginHelper

On Mon, Jul 31, 2023 at 11:04 PM Ricardo Garcia  wrote:

> Hi, I am migrating to camel 4, as part of a broader migration to all
> jakarta API instead of javax API
> In camel 3 I could load routes from multiple external xml files:
>
> try (DirectoryStream ds = Files.newDirectoryStream(routesDir, "*.xml"
> );
> DefaultResourceResolvers.FileResolver resolver = new
> DefaultResourceResolvers.FileResolver()) {
> resolver.setCamelContext(camelContext);
> for(Path file : ds)
> try {
> log.debug("Loading routes in {}", file);
> Resource resource = resolver.resolve(file.toUri().toString());
> camelContext.getRoutesLoader().loadRoutes(resource);
> } catch(Exception ex) {
> log.error("Cannot load routes in " + file, ex);
> }
> }
> But in camel 4 RC2, "getRoutesLoader()" does not exist in
> DefaultCamelContext, nor in ExtendedCamelContext... so how should we do it
> then?
> Thanks
>
> --
> Chipu
>


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


Fwd: loading routes from external xml files

2023-07-31 Thread Ricardo Garcia
Hi, I am migrating to camel 4, as part of a broader migration to all
jakarta API instead of javax API
In camel 3 I could load routes from multiple external xml files:

try (DirectoryStream ds = Files.newDirectoryStream(routesDir, "*.xml"
);
DefaultResourceResolvers.FileResolver resolver = new
DefaultResourceResolvers.FileResolver()) {
resolver.setCamelContext(camelContext);
for(Path file : ds)
try {
log.debug("Loading routes in {}", file);
Resource resource = resolver.resolve(file.toUri().toString());
camelContext.getRoutesLoader().loadRoutes(resource);
} catch(Exception ex) {
log.error("Cannot load routes in " + file, ex);
}
}
But in camel 4 RC2, "getRoutesLoader()" does not exist in
DefaultCamelContext, nor in ExtendedCamelContext... so how should we do it
then?
Thanks

-- 
Chipu


Connection Pooling in (S)FTP Component

2023-07-31 Thread ICS460-BAI
Hello,

due to the fact that we have many transports on a single server we need the 
ability to pool/reuse ftp connections.
Otherwise, we have to many reconnects or to many open connections!

Do you have any recommendations how we can realize such a connection pool. We 
are currently trying to pool the entire SftpOperations Object.
This does not work because the SftpOperations Object includes the SftpEndpoint 
which cannot be reused in different routes!

Please support us here. We really would like to achieve this with camel!

Keep up the great work!
Regards Christian

[signature_449552271]


Dipl.-Ing. Christian Müller
Software Engineer
ICS460-BAI





[cid:image510439.PNG@7db0b49f.4ca7cecf]

DI Christian Müller
Software Engineer
Business Automation & Integration


Mobile: +43 664 88748100
E-Mail: christian.muel...@spar-ics.com

SPAR Business Services GmbH
Information & Communication Services
Europastrasse 3, 5015 Salzburg, Austria



[cid:image5e16dd.PNG@36ca1112.45abf134]

Sollten Sie diese E-Mail unbeabsichtigt bzw. irrtümlich erhalten haben, so 
weisen wir Sie darauf hin, dass gemäß § 161 Abs 4 TKG 2021 der Inhalt sowie die 
Tatsache des Empfangs dieser E-Mail weder aufgezeichnet noch verwertet oder 
Unbefugten mitgeteilt werden dürfen. Wir ersuchen Sie, die Nachricht von Ihrem 
System zu löschen und sich mit uns in Verbindung zu setzen.
Unter diesem Link finden Sie die Informationen über die Verarbeitung Ihrer 
personenbezogenen Daten sowie zu Ihren Rechten als betroffene Person:
https://www.spar.at/service/datenschutzhinweise

If you have received this email accidentally or in error, we point out that, in 
accordance with § 161 para. 4 TKG 2021 (Telecommunications Act), the contents 
of this email and the fact of its receipt must not be recorded, exploited or 
communicated to unauthorized persons. We ask you to delete the message from 
your system and to contact us.
Under this link you will find information about the processing of your personal 
data and about your rights as a data subject
https://www.spar.at/service/datenschutzhinweise




How to read data from a paginated API and upload it as multipart file to S3 page by page

2023-07-31 Thread Sahil Upneja
Hi Everyone !

I am trying to read data from a paginated API , Since the whole data is
huge so I want to read one page from paginated API and upload it as
multipart file to S3 and then read 2nd page & upload it to S3 and so on.

Could you please let me know if this usecase is achievable through Camel.

If yes, could you please also share a little example on how to achieve this.

Regards
Sahil