camunda-bpm-platform icon indicating copy to clipboard operation
camunda-bpm-platform copied to clipboard

Refactor Camunda subsystem to use WildFly `subsystem` and `service` libraries

Open yanavasileva opened this issue 1 year ago • 1 comments

Acceptance Criteria (Required on creation)

  • Prerequisite: we know how to refactor the source code that uses org.jboss.msc.service.ServiceController.getService()/getValue().
  • Camunda subsystem use WildFly subsystem and service instead of JBoss MSC API

Hints

  • Created on behalf of https://github.com/camunda/camunda-bpm-platform/issues/3780#issuecomment-1940789819
  • Libraries are introduced in WildFly 31: https://www.wildfly.org/news/2024/01/25/WildFly31-Released/
  • https://github.com/camunda/camunda-bpm-platform/issues/4103

Links

Breakdown

### Pull Requests

yanavasileva avatar Feb 14 '24 12:02 yanavasileva

Notes from innovation week:

  • I didn't find any docs beside javadocs in the classes
  • Overall the issue with usage of non-encapsulated service is still problematic. We will need to re-write no matter of which new API we decide to use (org.jboss.msc.Service or the wildfly libraries)
  • subsystem
    • the library is used here: https://github.com/wildfly/wildfly-core/blob/23.0.3.Final/discovery and gives insights how to use the API
    • Attempt to use the library in our subsystem: https://github.com/camunda/camunda-bpm-platform/compare/master...4104-innovation-week
      • If we re-write the subsystem and draw the line, there might be more code that we have today.
      • But some of the code might be easier to read and understand if we adopt the library
  • service
    • There's a lot of code duplication from the subsystem module, that gives me a bit of uncertainty in the two libraries. But the author as far as I saw in the most classes is the same. Maybe they can improve that in the future.
    • Attempt to use the library in our subsystem: https://github.com/camunda/camunda-bpm-platform/compare/master...4104-innovation-week-services
      • adjusted only MscRuntimeContainerDelegate and MscBpmPlatformPlugins data don't have a lot of code => local run of engine IT was green with the changes
      • code can be reduce and readability improved if we adopt the library API
      • start and stop service methods must be re-written with tasks (org.wildfly.service.Installer.UnaryBuilder.onStart(Consumer<T>))
  • I raised https://github.com/jboss-msc/jboss-msc/pull/136 as I still think, there's an issue in JBoss MSC when the serviceId=null
    • Reported https://issues.redhat.com/browse/MSC-345

yanavasileva avatar Apr 17 '24 14:04 yanavasileva