camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10809) Introduce configurator SPI for rest support in camel-core
Date Wed, 08 Feb 2017 18:27:42 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-10809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858352#comment-15858352
] 

ASF GitHub Bot commented on CAMEL-10809:
----------------------------------------

GitHub user zregvart opened a pull request:

    https://github.com/apache/camel/pull/1454

    CAMEL-10809 Introduce configurator SPI for rest support in camel-core

    This removes the `SwaggerRestProducerFactory` and moves the
    responsibility of configuring rest clients to a new SPI
    (`RestEndpointConfigurer`).
    
    The rest endpoint URI has been changed to allow for syntax like:
    
        rest:<component>[:componentSpecific]
    
    Or in case of Swagger:
    
        rest:swagger:getPetById?apiDoc=petstore.json
    
    The SPI is discovered in the `META-INF/services/org/apache/camel/rest`
    properties file with the prefix `configurer.` so any other components
    wishing to configure rest endpoints via this configurer SPI should add
    `rest` file with `configurer.class` property.
    
    I would like feedback on the following issues:
     - instead of `META-INF/.../rest` use different properties file?
     - design of the RestEndpointConfigurer SPI interface (for instance: is
    it sufficient so that it can be used to plug in headers, or
    authentication callbacks for rest)
     - integration with service discovery ({{service:...}})?
     - properties missing from Swagger specification (notably host, and
    port) -- current idea is that that should be provided from
    `RestConfiguration`

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zregvart/camel CAMEL-10809

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1454.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1454
    
----
commit 59515f67706e588c2a86f2ba180be62c3264eb3a
Author: Zoran Regvart <zoran@regvart.com>
Date:   2017-02-08T18:25:44Z

    CAMEL-10809 Introduce configurator SPI for rest...
    
    ... support in camel-core
    
    This removes the `SwaggerRestProducerFactory` and moves the
    responsibility of configuring rest clients to a new SPI
    (`RestEndpointConfigurer`).
    
    The rest endpoint URI has been changed to allow for syntax like:
    
        rest:<component>[:componentSpecific]
    
    Or in case of Swagger:
    
        rest:swagger:getPetById?apiDoc=petstore.json
    
    The SPI is discovered in the `META-INF/services/org/apache/camel/rest`
    properties file with the prefix `configurer.` so any other components
    wishing to configure rest endpoints via this configurer SPI should add
    `rest` file with `configurer.class` property.
    
    I would like feedback on the following issues:
     - instead of `META-INF/.../rest` use different properties file?
     - design of the RestEndpointConfigurer SPI interface (for instance: is
    it sufficient so that it can be used to plug in headers, or
    authentication callbacks for rest)
     - integration with service discovery ({{service:...}})?
     - properties missing from Swagger specification (notably host, and
    port) -- current idea is that that should be provided from
    `RestConfiguration`

----


> Introduce configurator SPI for rest support in camel-core
> ---------------------------------------------------------
>
>                 Key: CAMEL-10809
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10809
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core, camel-swagger
>    Affects Versions: 2.19.0
>            Reporter: Zoran Regvart
>            Assignee: Zoran Regvart
>            Priority: Minor
>
> Camel core includes, albeit unpromoted feature implemented in CAMEL-10164 that allows
the creation of producers from api specifications. One such integration was done in Swagger
component, so you can create producers using the specified {{apiDoc}} parameter.
> I would like to change this a bit, and introduce a {{RestEndpointConfigurer}} that would
allow you to customize the endpoint, so a step before the producer customization/creation
takes place.
> This would allow for two things:
> - separation of concerns (configuring endpoint, creating producers)
> - possible extension to consumers (create specification first rest consumers)
> I would also like to propose the new rest endpoint URI syntax in addition to the existing
one, in the form of:
> {{rest:<component>\[:componentSpecific\]}}
> Or in case of Swagger, something like:
> {{rest:swagger:operationId}}
> For example, complete endpoint uri for getting a pet out of petstore (Swagger example)
would be:
> {{rest:swagger:getPetById?apiDoc=petstore.json}}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message