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

feat(connect): upgrade to apache httpclient 5.x #4408 #4569

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

strangelookingnerd
Copy link
Contributor

@strangelookingnerd strangelookingnerd commented Aug 30, 2024

Re-created from #4408

related to #4438

@strangelookingnerd strangelookingnerd force-pushed the feature/connect_supports_httpclient5 branch from e3b16d9 to 7144599 Compare September 2, 2024 08:26
@yanavasileva yanavasileva requested review from tasso94 and yanavasileva and removed request for tasso94 September 10, 2024 10:06
@strangelookingnerd strangelookingnerd force-pushed the feature/connect_supports_httpclient5 branch 2 times, most recently from f4ce42f to dc187a0 Compare September 16, 2024 14:00
@yanavasileva
Copy link
Member

Hi @strangelookingnerd,

Thank you for raising the PR.
I will get to it in the next weeks. But before that I will trigger our tests so I can give you early feedback on this.

Best,
Yana

@yanavasileva
Copy link
Member

@strangelookingnerd, I wanted to trigger the tests against this branch but the build is failing.
Could you have a look at it? In repo root:

mvn -s clean source:jar deploy source:test-jar com.mycila:license-maven-plugin:check -Pdistro,distro-ce,distro-wildfly,distro-webjar,h2-in-memory

Error that I see:

[2024-10-07T16:41:53.918Z] [ERROR] 'dependencies.dependency.version' for org.apache.httpcomponents.client5:httpclient5:jar must be a valid version but is '${version.httpclient5}'. @ line 66, column 16
[2024-10-07T16:41:53.918Z]  @ 
[2024-10-07T16:41:53.918Z] [INFO] [jenkins-event-spy] Generated /home/jenkins/agent/workspace/23_cambpm-ce_cambpm-main_PR-4680@tmp/withMaven8784d992/maven-spy-20241007-184141-92116238138332426972134.log
[2024-10-07T16:41:53.918Z] [ERROR] The build could not read 2 projects -> [Help 1]
[2024-10-07T16:41:53.918Z] [ERROR]   
[2024-10-07T16:41:53.918Z] [ERROR]   The project org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter-security:7.23.0-SNAPSHOT (/home/jenkins/agent/workspace/23_cambpm-ce_cambpm-main_PR-4680/spring-boot-starter/starter-security/pom.xml) has 1 error
[2024-10-07T16:41:53.918Z] [ERROR]     'dependencies.dependency.version' for org.apache.httpcomponents.client5:httpclient5:jar must be a valid version but is '${version.httpclient5}'. @ line 54, column 16
[2024-10-07T16:41:53.919Z] [ERROR]   
[2024-10-07T16:41:53.919Z] [ERROR]   The project org.camunda.bpm:camunda-external-task-client:7.23.0-SNAPSHOT (/home/jenkins/agent/workspace/23_cambpm-ce_cambpm-main_PR-4680/clients/java/client/pom.xml) has 1 error
[2024-10-07T16:41:53.919Z] [ERROR]     'dependencies.dependency.version' for org.apache.httpcomponents.client5:httpclient5:jar must be a valid version but is '${version.httpclient5}'. @ line 66, column 16
``

@strangelookingnerd strangelookingnerd force-pushed the feature/connect_supports_httpclient5 branch from a0262e7 to 8f584ec Compare October 10, 2024 13:24
@strangelookingnerd
Copy link
Contributor Author

@strangelookingnerd, I wanted to trigger the tests against this branch but the build is failing. Could you have a look at it?

I resolved the merge conflicts.

@strangelookingnerd strangelookingnerd force-pushed the feature/connect_supports_httpclient5 branch from 8f584ec to 3d05e62 Compare November 4, 2024 09:14
@strangelookingnerd strangelookingnerd force-pushed the feature/connect_supports_httpclient5 branch from 3d05e62 to 297d773 Compare November 13, 2024 21:23
@yanavasileva
Copy link
Member

Hi @strangelookingnerd,

There are some test failures related to the changes of this PR.
CamundaBpmSampleApplicationTest is failing in camunda-bpm-spring-boot-starter-security module (introduced in 7.22).
Could you please have a look? You can use the same command from my previous message to run the build.
I will start the review in my next working day. Thank you for your patience with this.

- implement connectors based on httpclient 5.x
- update README.md to reflect changes
- trivial code cleanup
* preserve compatibility

Co-authored-by: tasso94 <[email protected]>
- consolidate version.httpclient property
@strangelookingnerd strangelookingnerd force-pushed the feature/connect_supports_httpclient5 branch from 9035806 to 55dc4ed Compare November 17, 2024 11:46
- set version.httpclient to 5.3.1
@strangelookingnerd strangelookingnerd force-pushed the feature/connect_supports_httpclient5 branch from 55dc4ed to ffc14f8 Compare November 17, 2024 13:09
@strangelookingnerd
Copy link
Contributor Author

Hi @strangelookingnerd,

There are some test failures related to the changes of this PR. CamundaBpmSampleApplicationTest is failing in camunda-bpm-spring-boot-starter-security module (introduced in 7.22). Could you please have a look? You can use the same command from my previous message to run the build. I will start the review in my next working day. Thank you for your patience with this.

Seems like there is a version mismatch for httpclient5 dependencies when using spring-boot-dependencies. Spring still relies on 5.3.1 which itself relies on 5.2.2 of httpcore5. This does not work with httpclient5 in 5.4.1 as I proposed and is causing tests to fail with

Caused by: java.lang.NoSuchMethodError: 'void org.apache.hc.core5.http.impl.io.DefaultHttpRequestWriterFactory.<init>(org.apache.hc.core5.http.config.Http1Config)'

Now there is two options:

  1. override all of the related dependencies from spring-boot-dependencies
  2. simply rely on the same version spring-boot-dependencies provides

In my experience the second option will cause way less headache further down the road. I downgraded the <version.httpclient> property to 5.3.1 to match spring-boot-dependencies. This way the build runs succesfully. There is hope that a more recent version of spring-boot-dependencies will at some point also use the newer versions of httpclient5 and httpcore5.

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

Successfully merging this pull request may close these issues.

2 participants