{"id":26032602,"url":"https://github.com/apache/karaf-reactive-components","last_synced_at":"2025-04-09T23:52:40.957Z","repository":{"id":65979496,"uuid":"107861331","full_name":"apache/karaf-reactive-components","owner":"apache","description":"Apache Karaf Reactive Components","archived":false,"fork":false,"pushed_at":"2023-04-14T19:34:45.000Z","size":149,"stargazers_count":2,"open_issues_count":3,"forks_count":3,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-03T04:17:02.495Z","etag":null,"topics":["java","karaf","network-server","osgi"],"latest_commit_sha":null,"homepage":"https://karaf.apache.org/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-22T11:51:17.000Z","updated_at":"2022-12-22T09:17:01.000Z","dependencies_parsed_at":"2023-02-19T19:31:10.948Z","dependency_job_id":null,"html_url":"https://github.com/apache/karaf-reactive-components","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-reactive-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-reactive-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-reactive-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-reactive-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/karaf-reactive-components/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247899475,"owners_count":21014905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","karaf","network-server","osgi"],"created_at":"2025-03-06T22:13:52.821Z","updated_at":"2025-04-09T23:52:40.929Z","avatar_url":"https://github.com/apache.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prototype of reactive components and reactor based streams\n\n## Scope\n\nI recently experimented with reactive streams and a small component framework.\nThe goal is to have a small API that can encapsulate a protocol and transport. \nThe code using a reactive component should not directly depend on the specifics of the transport or protocol.\nAnother goal is to have reactive features like backpressure. \n\nUltimately I am searching for something like Apache Camel Components but with a lot less coupling. \nIn camel the big problem is that components depend on camel core which unfortunately is much more than a component API.\nSo any camel component is coupled quite tightly to all of camel core.\n\nCurrently reactive components is built on top of OSGi to leverage configuration mechanisms as well as finding components as OSGi services.\nConceptually this is not limited to OSGi though. With a suitable plugin and config mechanism this could easily be used on spring boot or similar too.\nSo I am interested in bringing this to other platforms too. \n\n## Build\n\n```\nmvn clean install -DskipTests\n```\n\n## Examples\n\n* [Mqtt and Eventadmin](rcomp-examples/rcomp-examples)\n* [Alternative Decanter Kafka appender](rcomp-examples/kafka-appender)\n\n## Component API\n\nI was trying to find the simplest API that would allow similar components to camel in one way mode.\nThis is what I currently use (https://github.com/cschneider/streaming-osgi/blob/master/rcomp-api/src/main/java/component/api/MComponent.java).\n\n```\npublic interface RComponent {\n    \u003cT\u003e Publisher\u003cT\u003e from(String destination, Class\u003cT\u003e type);\n    \u003cT\u003e Subscriber\u003cT\u003e to(String destination, Class\u003cT\u003e type);\n}\n```\n\nA component is a factory for Publishers and Subscribers. From and to have the same meaning as in camel. The component can be given a source / target type to produce / consume. So with the OSGi Converter spec this would allow to have type safe messaging without coding the conversion in every component. Each component is exposed as a service which encapsulates most of the configuration. All endpoint specific configuration can be done using the destination String.\n\nPublisher and Subscriber are interfaces from the reactive streams api (http://www.reactive-streams.org/). So they are well defined and have zero additional dependencies.\n\nOne example for such a component is the MqttComponent https://github.com/cschneider/streaming-osgi/blob/master/rcomp-mqtt/src/main/java/component/mqtt/MqttComponent.java.\n\n## Possible use cases\n\nTwo big use cases are reactive microservices that need messaging integrations as well as plain camel like integrations.\nAnother case are the Apache Karaf decanter collectors and appenders. Currently they use a decanter specific API but they could easily be converted into the more general rcomp api.\nWe could also create a bridge to camel components to leverage the many existing camel components using the rcomp API as well as offering rcomp components to camel.\n\nComponents alone are of course not enough. One big strength of Apache Camel is the DSL. In case of rcomp I propose to not create our own DSL and instead use existing DSLs that work well in OSGi. Two examples:\n\n* [Akka and reactive streams](https://de.slideshare.net/ktoso/reactive-integrations-with-akka-streams)\n* [Reactor and reactive streams](https://de.slideshare.net/StphaneMaldini/reactor-30-a-reactive-foundation-for-java-8-and-spring)\n\nIt is already possible to integrate CXF Rest services with reactive streams using some adapters but we could have native integration.\n\n## Risks and Opportunities\n\nThe main risk I see is not gathering a critical mass of components to draw more people. \nAnother risk is that the RComponent API or the reactor streams have some unexpected limitations. \nThe big opportunity I see is that the rcomp API is very simple so the barrier of entry is low. \nI also hope that this might become a new foundation for a simpler and more modern Apache Camel.\n\nSo this all depends on getting some support by you all. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkaraf-reactive-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fkaraf-reactive-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkaraf-reactive-components/lists"}