Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin documentation incorrect for kotlin DSL #1426

Closed
dylanenabled opened this issue Apr 24, 2020 · 5 comments
Closed

Kotlin documentation incorrect for kotlin DSL #1426

dylanenabled opened this issue Apr 24, 2020 · 5 comments
Assignees

Comments

@dylanenabled
Copy link

dylanenabled commented Apr 24, 2020

The kotlin documentation here https://camel.apache.org/camel-k/latest/languages/kotlin.html is incorrect for the kotlin dsl (registry and component configurations).

it says context when it should say camel

context {
    components {
        component<SedaComponent>("seda") { 
            queueSize = 1234
            concurrentConsumers = 12
        }

        component<SedaComponent>("mySeda") { 
            queueSize = 4321
            concurrentConsumers = 21
        }

        component<LogComponent>("log") { 
           setExchangeFormatter {
               e: Exchange -> "" + e.getIn().body
           }
       }
    }
}

should be

camel {
    components {
        component<SedaComponent>("seda") { 
            queueSize = 1234
            concurrentConsumers = 12
        }

        component<SedaComponent>("mySeda") { 
            queueSize = 4321
            concurrentConsumers = 21
        }

        component<LogComponent>("log") { 
           setExchangeFormatter {
               e: Exchange -> "" + e.getIn().body
           }
       }
    }
}
@dylanenabled
Copy link
Author

Actually I'm not sure how to get the registry example working, as that doesn't seem to be defined under camel, and it says it is private when I try to use it in the global scope.

@lburgazzoli
Copy link
Contributor

That documentation need to be updated :)

The registry has been removed in favour of a "bean dsl":

beans {
    bean<org.apache.commons.dbcp2.BasicDataSource>("dataSource") {
        driverClassName = "org.h2.Driver"
        url = "jdbc:h2:mem:camel"
        username = "sa"
        password = ""
    }

    bean("filterStrategy") {
        org.apache.camel.support.DefaultHeaderFilterStrategy()
    }

    processor("myProcessor") {
        it.getIn().body = "Hello"
    }

    predicate("myPredicate") {
        false
    }
}

@dylanenabled
Copy link
Author

Great, Thanks

@oscerd oscerd self-assigned this May 14, 2020
@oscerd
Copy link
Contributor

oscerd commented May 14, 2020

@oscerd
Copy link
Contributor

oscerd commented May 14, 2020

Fixed

@oscerd oscerd closed this as completed May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants