ppalaga commented on a change in pull request #201: Fix #184 Leverage platform http service URL: https://github.com/apache/camel-quarkus/pull/201#discussion_r329008926
########## File path: extensions/platform-http/component/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java ########## @@ -0,0 +1,132 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.platform.http; + +import java.util.Collections; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.camel.AsyncEndpoint; +import org.apache.camel.Component; +import org.apache.camel.Consumer; +import org.apache.camel.Processor; +import org.apache.camel.Producer; +import org.apache.camel.component.platform.http.spi.Method; +import org.apache.camel.component.platform.http.spi.PlatformHttpEngine; +import org.apache.camel.spi.HeaderFilterStrategy; +import org.apache.camel.spi.HeaderFilterStrategyAware; +import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.spi.UriParam; +import org.apache.camel.support.DefaultEndpoint; + +@UriEndpoint(/* firstVersion = "3.?.0", */ scheme = "platform-http", title = "Platform HTTP", syntax = "platform-http:[methods:]path", label = "http") +public class PlatformHttpEndpoint extends DefaultEndpoint implements AsyncEndpoint, HeaderFilterStrategyAware { + + private final String path; + private final Set<Method> methods; + + @UriParam(label = "consumer", description = "A comma separated list of HTTP methods to serve. This list will be merged with the methods specified in the URI path. E.g. platform-http:GET,POST:/path?httpMethodRestrict=PUT,DELETE will effectivelly result in GET,POST,PUT,DELETE. If no methods are specified, all methods will be served.") + private String httpMethodRestrict; Review comment: The component is incubating here and the API/SPI will eventually move to Camel when it is mature enough. So IMO this is a way how to address it in Camel. I agree that consistency with the old stuff is nice when migrating and to keep the old knowledge usable but the developer experience is the king for green field projects where the old stuff does not matter that much. It is amazing to see how excited people get when they see Panache. Applying your argument there, Panache should not be introduced because it is reaching the same goal as the well established Hibernate? I do not think that would be the right approach. I see `platform-http` as the new generation of the HTTP components where we SHOULD be compatible with the old generation as far as possible but at the same time it should not block us from improving things. Having to type 18 chars less to define a route is IMO an improvement that justifies having two ways of configuring the same thing. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services