{"id":18011766,"url":"https://github.com/renatoathaydes/aries-rsa-example","last_synced_at":"2025-04-04T13:43:52.491Z","repository":{"id":138191945,"uuid":"108756756","full_name":"renatoathaydes/aries-rsa-example","owner":"renatoathaydes","description":"Aries RSA Example using Gradle and the Protobuf-TCP provider.","archived":false,"fork":false,"pushed_at":"2017-11-05T15:30:40.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T23:28:30.454Z","etag":null,"topics":["apache-aries","osgi","osgi-declarative-services","osgi-services"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renatoathaydes.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-29T17:46:18.000Z","updated_at":"2017-10-29T18:47:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"b463168f-503d-49bf-b0b6-b88a5953d426","html_url":"https://github.com/renatoathaydes/aries-rsa-example","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/renatoathaydes%2Faries-rsa-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatoathaydes%2Faries-rsa-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatoathaydes%2Faries-rsa-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatoathaydes%2Faries-rsa-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renatoathaydes","download_url":"https://codeload.github.com/renatoathaydes/aries-rsa-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247189521,"owners_count":20898691,"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":["apache-aries","osgi","osgi-declarative-services","osgi-services"],"created_at":"2024-10-30T03:12:45.925Z","updated_at":"2025-04-04T13:43:52.472Z","avatar_url":"https://github.com/renatoathaydes.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aries RSA Example\n\nThis is an example application showing how to use Apache [Aries RSA](http://aries.apache.org/modules/rsa.html)\nand Gradle.\n\nIt uses the [`org.dm.bundle`](https://github.com/TomDmitriev/gradle-bundle-plugin) plugin to\nbundlify the jar and [`osgi-run`](https://github.com/renatoathaydes/osgi-run) to build the\nOSGi runtime.\n\nIt uses the [Protobuffer-TCP](https://github.com/renatoathaydes/protobuf-tcp-rsa-provider) `DistributionProvider`,\nso the remote services rely on [Protobuffer](https://developers.google.com/protocol-buffers/)\nfor serialization.\n\nService wiring is performed via Declarative services annotations and a XML descriptor for the client to find the remote\nservice (this is implemented by the [Local Discovery](https://github.com/apache/aries-rsa/tree/master/discovery/local) \nAries bundle).\n\n## Building and running\n\nTo build the server distribution, simply run:\n\n```\n./gradlew creOsgi\n```\n\nThis will create a OSGi environment under `build/server/`.\n\nTo build the client:\n\n```\n./gradlew creOsgi -Pclient\n```\n\nThis will create a OSGi environment under `build/client/`.\n\nTo run the server on Linux/Mac:\n\n```\nbash build/server/run.sh\n```\n\nOn Windows:\n\n```\nbuild/server/run.bat\n```\n\nSimilarly, to run the client:\n\n```\nbash build/client/run.sh\n```\n\nOn both server and client, a [OSGiaaS-CLI shell](https://sites.google.com/a/athaydes.com/renato-athaydes/posts/osgiaas-cli-aclitoruncommandswritteninjvmlanguages?pli=1) \nis started, which allows you to inspect the OSGi environment.\n\nFor example, run `ps` to see the installed bundles, or `headers 3` to see the configuration of bundle with ID `3`.\n\nThe client exports a command called `send-msg` which can be used to send a String to the server.\n\nExample:\n\n```\nosgiaas\u003e send-msg hello server\nSending TestInfo message: hello server\nGot response back: info {\n  testClass: \"class java.lang.String\"\n  testMethod: \"hello server\"\n}\nstatus: SUCCESS\n```\n\n## Project structure\n\nThere are 3 modules in this project:\n\n### API module\n\nContains the Protobuffer definitions, i.e. the serializable objects that will be exchanged between client and server.\n\nThe Protobuffer definitions can be found in [messages.proto](api/src/main/proto/messages.proto).\n\nThis module also defines a very simple service interface, \n[`MessageService`](api/src/main/java/com/athaydes/osgi/api/MessageService.java).\n\n### osgi-server module\n\nThe server-side of this application. It simply implements `MessageService` with a class named\n[`TestServer`](osgi-server/src/main/java/com/athaydes/osgi/server/TestServer.java).\n\nAs you can see in the Java class, the service is exported using the Declarative Services annotation:\n\n```java\n@Component(immediate = true, property = {\n        \"service.exported.interfaces=*\",\n        \"com.athaydes.protobuf.port=5561\"\n})\npublic class TestServer implements MessageService\n``` \n\n`service.exported.interfaces=*` marks the service for remote export.\n`com.athaydes.protobuf.port=5561` tells the `Protobuffer-TCP` provider which port to use.\n\n### osgi-client module\n\nClient-side module. It contains only a single class, \n[`MessageSender`](osgi-client/src/main/java/com/athaydes/osgi/client/MessageSender.java), which consumes the\n`MessageService` service, and locally exports the `org.apache.felix.shell.Command` service so that the CLI\ncan see the `send-msg` command it implements.\n\nTo find the remote `MessageSender` service, this bundle provides a \n[XML descriptor](osgi-client/src/main/resources/OSGI-INF/remote-service/server.xml) which is used by the\n[Local Discovery](https://github.com/apache/aries-rsa/tree/master/discovery/local) Aries bundle to wire the service.\n\n## OSGi environment\n\nAll bundles required to run this application can be found in the [build.gradle](build.gradle) file, under \n`dependencies` and the `runOsgi` blocks.\n\nType `./gradlew dep` to see the dependency tree, or, after starting the CLI, type `ps` to see all installed bundles.\n\n\u003e IMPORTANT: Notice that the RSA Topology Manager must have a start level higher than the RSA Core bundle otherwise\n  the Topology Manager might fail to see the RSA Admin Service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatoathaydes%2Faries-rsa-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenatoathaydes%2Faries-rsa-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatoathaydes%2Faries-rsa-example/lists"}