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

Ewen Cheslack-Postava commented on KAFKA-6914:
----------------------------------------------

[~sriramks85] Spring Boot is handy for creating your own apps, but I'm not sure 
it's really the right solution for *repackaging* an existing app.

Spring Boot combined with pluggable systems that require plugin discovery are 
likely to generally run into problems. Since it's a custom approach to Spring 
Boot, it's hard to generically support that deployment model. The current 
solution you have is definitely touching internal APIs that are not guaranteed 
to be stable, so it's not a great long term solution. The proposed fix is also 
relying on internal APIs that, again, are not guaranteed to be stable. I think 
a real solution here probably requires some further thought, more broadly than 
just Spring Boot, about how custom classloaders are used and how they interact 
with plugin-based systems like Connect. Are there any similar examples that you 
know of for plugin-based systems that face these same challenges? And 
relatedly, for your particular case, does just using an uber jar approach not 
work? Are you trying to support a variety of connectors with potentially 
conflicting dependencies, or are you packaging a single connector for 
deployment on OpenShift?

 

[~flyaruu] This seems like it is probably reasonable – I don't think you're 
missing intention, but rather from the 99% use case we see the system 
classloader *is* the DelegatingClassLoader's classloader, so it's probably more 
of an oversight/bug. [~kkonstantine] thoughts? Seems like a pretty trivial fix 
(though difficult to include good tests for, as per usual with this classloader 
stuff).

> Kafka Connect - Plugins class should have a constructor that can take in 
> parent ClassLoader
> -------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-6914
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6914
>             Project: Kafka
>          Issue Type: Improvement
>          Components: KafkaConnect
>            Reporter: Sriram KS
>            Priority: Minor
>
> Currently Plugins class has a single constructor that takes in map of props.
> Please make Plugin class to have a constructor that takes in a classLoader as 
> well and use it to set DelegationClassLoader's parent classLoader.
> Reason:
> This will be useful if i am already having a managed class Loader environment 
> like a Spring boot app which resolves my class dependencies using my 
> maven/gradle dependency management.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to