Closed rhuss closed 6 years ago
Well, looks like it already has changed before 2.20.0 but the connectors has not been updated yet. A bit lost.
The compile error is
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project http-get-connector: Compilation failure
[ERROR] /Users/roland/Development/syndesis/syndesis/connectors/connectors/http/http-get-connector/src/main/java/io/syndesis/connector/http/springboot/HttpGetConnectorAutoConfiguration.java:[93,42] constructor HttpGetComponent in class io.syndesis.connector.http.HttpGetComponent cannot be applied to given types;
[ERROR] required: no arguments
[ERROR] found: java.lang.String
[ERROR] reason: actual and formal argument lists differ in length
[ERROR]
[ERROR] -> [Help 1]
and the generator code in question:
for (Map.Entry<String, HttpGetConnectorConfigurationCommon> entry : configuration
.getConfigurations().entrySet()) {
parameters.clear();
HttpGetComponent connector = new HttpGetComponent(entry.getKey());
.....
but HttpGetComponent (our code) has only a no-arg constructor.
@zregvart ah, yes ;-) So, what would I have todo to fix this in our components ?
btw, feels a bit strange for a patch level version to have an API change (but I'm not complaining as we are probably the only user of thise feature ...)
@rhuss I guess the same thing that was introduced in that change for the Foo
and Bar
connectors:
Add constructor argument for componentScheme
, haven't tried but it looks like a solution.
@zregvart thanks ! I'm going to fix this. Nevertheless we should not generate into the source directory. I change the title of the issue accrordingly.
@rhuss this is a unfortunate consequence of two things:
I will work upstream to improve the maven plugin but I think for syndesis we should work on having a simplified version of the connectors stuffs first so we can get rid of the generated code and once we have something stable we can eventually contribute it back to camel upstream.
@lburgazzoli sounds like a plan, thanks ;-)
I updated everything for Camel 2.20.1 in #453 (sorry for this all-in-one PR but I'm really busy fixing build stuff so please forgive me to not bother much about separate PRs)
Oops, was already merged ;-) that's the next one --> #459
@lburgazzoli is it correct that in this line --> https://github.com/rhuss/syndesis/blob/4db9c6839a6e2011970d3fcc9edcb4fefb6e4a1a/connectors/connectors/twitter/twitter-search-connector/src/main/java/io/syndesis/search/TwitterSearchComponent.java#L31
the "twitter-" prefix needs to be removed because its already part of the base scheme ? (same for all other connectors, too ?)
That worked for the other connectors, however for twitte the baseScheme is "twitter-timeline" not "twitter" (so leading to a "twitter-timeline-mention-connector")
I wonder how this affects the deployment.json and the data contained in our database ?
Not sure how to resolve this since it seems that "twitter-mention-connector" (instead of "twitter-timeline-mention-connector" as derived from the baseScheme) is quite used a bit in the code (just search for "twitter-mention-connector")
Hmm, I really dont get it:
twitterEndpoint.getEndpointUri().equals("twitter-timeline-mention-connector")
but in this test the from
still needs to be twitter-mention-connector
(??)
@Configuration
public static class TestConfiguration {
@Bean
public RouteBuilder routeBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("twitter-mention-connector")
.noAutoStartup()
.to("mock:result");
}
};
}
}
Sorry, I have to give up. For the twitter search connector I get a 'twitter-search-search-connector' URI when I use search-connector
as name in the TwitterSearchComponent. I reduced it now to connector
only for the TwitterSearchComponent, so that the overall URI name is calculated again to twitter-search-connector
(where twitter-search
comes from the baseScheme).
Not really sure what I'm doing here ....
That is the generated underlying scheme which is not supposed to be directly used, for an end user it would be search-connector
(or something like that) but the underlying component the connector configures needs to have a different name which is the result of the concatenation of some of the info the connector has at construction time.
It needs to be improved but it require a review of the connectors code.
Thanks, however still not sure that I understand it properly ;-)
The PR #459 for migration to 2.20.1 has grown a bit (because of other fixes like license headers), so I suggest to merge #459 and then revisit the connector names as used within the code and referenced from the outside.
@lburgazzoli @zregvart Now that PR #459 is merged, could you please have a quick look at the TwitterMentionConnector and TwitterSearchConnector and the corresponding unit tests, especially whether the names chosen make sense ?
@lburgazzoli @zregvart Any comment on this? Do we need this for TP3, is it already fixed, or can we defer?
I think that this can be deferred as we need to fix it at camel and with new connectors stuffs there is no more code generation involved.
I think we can close this one as new connectors do not have any generated code, @rhuss is that ok ?
Of course, if there is no code generated anymore than this issue is obsolete.
Generated code of camel-connector-maven-plugin changed signature between 2.20.0 and 2.20.1. I.e some call to component constructors now requires a string argument, which our connector definitions (twitter. htp-get) do not have. @lburgazzoli any idea what changed here ?
Actually, I found it quite unfortunate that the generated code is created in
src/main
and not belowtarget
as it should be for generated stuff. Also, we must not commit generated code when its generated during each run as part of the regular build.