Skip to content

CAMEL-22423: ContextServicePlugin SPI - provides a plugin system for Apache Camel …#19213

Merged
Croway merged 1 commit intoapache:mainfrom
Croway:context-service-plugin
Sep 18, 2025
Merged

CAMEL-22423: ContextServicePlugin SPI - provides a plugin system for Apache Camel …#19213
Croway merged 1 commit intoapache:mainfrom
Croway:context-service-plugin

Conversation

@Croway
Copy link
Contributor

@Croway Croway commented Sep 16, 2025

…that allows automatic discovery and initialization of third-party components during CamelContext startup.

The ContextServicePlugin provides an entry point into the Camel Context for third party plugins. This way, 3d party dependencies can be created to offer independent, additional features to a Camel application.

For example, a set of custom beans can be easily provided by

public class MyContextServicePlugin implements ContextServicePlugin {
    @Override
    public void load(CamelContext camelContext) {
        camelContext.getRegistry().bind("myBean", new TestBean());
        camelContext.getRegistry().bind("mySecondBean", new AnotherTestBean());
        ...
    }
}

and the service META-INF/services/org.apache.camel.spi.ContextServicePlugin with content com.foo.acme.TestPlugin

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

Copy link
Contributor

@orpiske orpiske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! I think it would be good to have a ticket and a small note on the 4.15 migration doc.

@Croway
Copy link
Contributor Author

Croway commented Sep 17, 2025

https://issues.apache.org/jira/browse/CAMEL-22423

@Croway Croway changed the title ContextServicePlugin SPI - provides a plugin system for Apache Camel … CAMEL-22423: ContextServicePlugin SPI - provides a plugin system for Apache Camel … Sep 17, 2025
…that allows automatic discovery and initialization of third-party components during CamelContext startup.
@Croway Croway force-pushed the context-service-plugin branch from d2503fd to 534a2ca Compare September 17, 2025 07:52
@Croway Croway merged commit 1c810bb into apache:main Sep 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants