You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mikael Andersson Wigander <mi...@gmail.com> on 2020/04/20 13:11:45 UTC

Camel Quarkus toD with dynamic values?

Hi

trying to convert a small Camel application to Quarkus but fails on this:

                from(timer("{{esma.download.timer}}").repeatCount(1))
                .log("{{esma.download.url}}")
                .toD(https("{{esma.download.url}}"))
esma:
  download:
    url : registers.esma.europa.eu/solr/esma_registers_firds_files/select?q=*&fq=publication_date:%5B${date:now-72h:yyyy-MM-dd}T00:00:00Z%20TO%20${date:now-24h:yyyy-MM-dd}T23:59:59Z%5D&wt=xml&indent=false&start=0&rows=100



first it cannot interpret the log it prints “{{esma.download.url}}” to the console

then it doesn’t convert my simple date calculations in the string

What do i need to make this happen?

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>${quarkus.platform.group-id}</groupId>
            <artifactId>${quarkus.platform.artifact-id}</artifactId>
            <version>${quarkus.platform.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.quarkus</groupId>
            <artifactId>camel-quarkus-bom</artifactId>
            <version>1.0.0-M6</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
Other “{{}}” values in the from/to endpoints work…

Thx

M

Re: Camel Quarkus toD with dynamic values?

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

What version of Camel are you using? I think we had a bug in
endpoint-dsl with {{ }} placeholders, that only has been fixed in the
upcoming 3.3 release.
And it may work in older Camel like 3.1.0. Or dont use the endpoint
dsl and regular camel uri strings

On Mon, Apr 20, 2020 at 3:11 PM Mikael Andersson Wigander
<mi...@gmail.com> wrote:
>
> Hi
>
> trying to convert a small Camel application to Quarkus but fails on this:
>
>                 from(timer("{{esma.download.timer}}").repeatCount(1))
>                 .log("{{esma.download.url}}")
>                 .toD(https("{{esma.download.url}}"))
> esma:
>   download:
>     url : registers.esma.europa.eu/solr/esma_registers_firds_files/select?q=*&fq=publication_date:%5B${date:now-72h:yyyy-MM-dd}T00:00:00Z%20TO%20${date:now-24h:yyyy-MM-dd}T23:59:59Z%5D&wt=xml&indent=false&start=0&rows=100
>
>
>
> first it cannot interpret the log it prints “{{esma.download.url}}” to the console
>
> then it doesn’t convert my simple date calculations in the string
>
> What do i need to make this happen?
>
> <dependencyManagement>
>     <dependencies>
>         <dependency>
>             <groupId>${quarkus.platform.group-id}</groupId>
>             <artifactId>${quarkus.platform.artifact-id}</artifactId>
>             <version>${quarkus.platform.version}</version>
>             <type>pom</type>
>             <scope>import</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.camel.quarkus</groupId>
>             <artifactId>camel-quarkus-bom</artifactId>
>             <version>1.0.0-M6</version>
>             <type>pom</type>
>             <scope>import</scope>
>         </dependency>
>     </dependencies>
> </dependencyManagement>
> Other “{{}}” values in the from/to endpoints work…
>
> Thx
>
> M



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

Re: Camel Quarkus toD with dynamic values?

Posted by Rafael Soares <ra...@gmail.com>.
Try to use the "URI STRING FORMATTING" *toF()* and *fromF()*...

from("direct:start").*toF*("file://%s?fileName=%s", path, name); *fromF*(
"file://%s?include=%s", path, pattern).toF("mock:%s", result);

Also, inject your properties using the Quarkus Microprofile @ConfigProperty
(org.eclipse.microprofile.config.inject.ConfigProperty)


________________________
Rafael Torres Coelho Soares


On Mon, Apr 20, 2020 at 9:12 AM Mikael Andersson Wigander <
mikael.grevsten@gmail.com> wrote:

> Hi
>
> trying to convert a small Camel application to Quarkus but fails on this:
>
>                 from(timer("{{esma.download.timer}}").repeatCount(1))
>                 .log("{{esma.download.url}}")
>                 .toD(https("{{esma.download.url}}"))
> esma:
>   download:
>     url :
> registers.esma.europa.eu/solr/esma_registers_firds_files/select?q=*&fq=publication_date:%5B${date:now-72h:yyyy-MM-dd}T00:00:00Z%20TO%20${date:now-24h:yyyy-MM-dd}T23:59:59Z%5D&wt=xml&indent=false&start=0&rows=100
> <http://registers.esma.europa.eu/solr/esma_registers_firds_files/select?q=*&fq=publication_date:%5B$%7Bdate:now-72h:yyyy-MM-dd%7DT00:00:00Z%20TO%20$%7Bdate:now-24h:yyyy-MM-dd%7DT23:59:59Z%5D&wt=xml&indent=false&start=0&rows=100>
>
>
>
> first it cannot interpret the log it prints “{{esma.download.url}}” to the
> console
>
> then it doesn’t convert my simple date calculations in the string
>
> What do i need to make this happen?
>
> <dependencyManagement>
>     <dependencies>
>         <dependency>
>             <groupId>${quarkus.platform.group-id}</groupId>
>             <artifactId>${quarkus.platform.artifact-id}</artifactId>
>             <version>${quarkus.platform.version}</version>
>             <type>pom</type>
>             <scope>import</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.camel.quarkus</groupId>
>             <artifactId>camel-quarkus-bom</artifactId>
>             <version>1.0.0-M6</version>
>             <type>pom</type>
>             <scope>import</scope>
>         </dependency>
>     </dependencies>
> </dependencyManagement>
> Other “{{}}” values in the from/to endpoints work…
>
> Thx
>
> M