Search code examples
javaspring-bootapache-camelsmbcifs

Connect SMB endpoint with Camel v3 and the camel-jcifs from camel-extra


I have the following maven versions in my pom.xml (among others):

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-spring-boot-starter</artifactId>
    <version>3.7.0</version>
</dependency>
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-core</artifactId>
    <version>3.7.0</version>
</dependency>

<dependency>
    <groupId>org.apache-extras.camel-extra</groupId>
    <artifactId>camel-jcifs</artifactId>
    <version>2.25.2</version>
    <exclusions>
        <exclusion>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Camel spring-boot version = 3.7.0 and I want to connect to a SMB endpoint like this:

smb://[email protected]/folder?initialDelay=0&delay=9000&autoCreate=false&noop=true&idempotent=true&password=ThePassWorD&filter=#csvFileFilter

I read the Camel 3 Migration Guide and found nothing regarding this camel-extras.

When trying to connect, I get an error like the password option is not supported anymore:

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: smb://[email protected]/folder?initialDelay=0&delay=9000&autoCreate=false&noop=true&idempotent=true&password=xxxxxx&filter=#csvFileFilter due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{password=ThePassWorD}]

The actual documentation link google found many times, seems dead.

From Maven central, there is no version 3.x of the lib camel-jcifs and I am wondering if the lib is still compatible with Camel 3.x.x, otherwise is there another alternative with Camel 3?

I also tried to downgrade the camel-jcifs to 2.24.3 with the same error.


Solution

  • There is now a pull request to add camel-jcifs to the 3.x version:

    https://github.com/camel-extra/camel-extra/pull/39

    You might also get my fork and build it yourself:

    It got merged and is in the official repository:

    https://github.com/camel-extra/camel-extra

    To use it with quarkus, you have to convert some List types to arrays.