{"id":19795272,"url":"https://github.com/spliterash/pubsubmessaging","last_synced_at":"2025-10-07T19:06:26.324Z","repository":{"id":129949673,"uuid":"532530814","full_name":"Spliterash/PubSubMessaging","owner":"Spliterash","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-15T19:38:32.000Z","size":139,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T20:28:37.858Z","etag":null,"topics":[],"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/Spliterash.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":"2022-09-04T12:15:36.000Z","updated_at":"2025-02-15T19:38:36.000Z","dependencies_parsed_at":"2024-11-12T07:15:56.511Z","dependency_job_id":"22500609-eeba-4de4-b3a3-15242be0cfb1","html_url":"https://github.com/Spliterash/PubSubMessaging","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/Spliterash%2FPubSubMessaging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spliterash%2FPubSubMessaging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spliterash%2FPubSubMessaging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spliterash%2FPubSubMessaging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spliterash","download_url":"https://codeload.github.com/Spliterash/PubSubMessaging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241137268,"owners_count":19916092,"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":[],"created_at":"2024-11-12T07:15:54.216Z","updated_at":"2025-10-07T19:06:26.198Z","avatar_url":"https://github.com/Spliterash.png","language":"Java","readme":"# PubSub Service Messaging\n\n\n## Warning\nIf you don't have a good reason to use this, then it's better to use another RPC sustem, because\nI wrote this library for faster and more convenient requests between specific game servers\n\nYou will also not be able to check if the server is alive, or it simply decided not to respond to your request.\n\nIn general, this library is extremely situational.\n\n## Introduction\nThis simple library allows you to make requests between your server, or in other words, this is an RPC implementation running on the pub/sub system.\n\n\nRegistration and request send very similar to feign\n\nResource Description\n```java\npublic interface PlayerResource {\n    @Request(\"player-info\") // All requests inside one resource must be unique\n    PlayerInfo getInfo(UUID playerUUID);\n}\n```\nResource Implementation\n```java\n@RequiredArgsConstructor\npublic class PlayerController implements PlayerResource {\n    private final PlayerInfoRepository repository;\n    public PlayerInfo getInfo(UUID playerUUID) throws PlayerNotFoudnException{\n        return repository.getInfo(playerUUID);\n    }\n}\n```\nRegister implementation\n```java\nPubSubMessagingService service;\nPlayerController controller;\n\nservice.registerHandler(PlayerResource.class, controller);\n```\nSend request and get response\n```java\nPlayerResource client = service.createClient(\"serverId\", PlayerResource.class);\ntry {\n    PlayerInfo info = client.getInfo(playerUUID);\n    log.info(\"Received player info: \"+ info);\n} catch(PubSubTimeout timeoutExp) {\n    log.warn(\"Response not received in 5 second\");\n} catch(PlayerNotFoundException notFoundExp) {\n    log.warn(\"Player not found\")   \n}\n```\n\n# Initialization\n\nFirst of all, you need to connect the maven repository and library BOM\n\n```kotlin\nrepositories {\n    maven(\"https://repo.spliterash.ru/group/\") {\n        content { includeGroup(\"ru.spliterash\") } // To just not stress for all other dependencies\n    }\n}\n\ndependencies {\n    // Not working on gradle lower 6\n    implementation(platform(\"ru.spliterash:pub-sub-messaging-bom:1.0.0-SNAPSHOT\"))\n}\n```\n\nThe library is written using dependency inversion, so you can build it as a constructor for your infrastructure\n\n### Standalone application\nIf you have a server application, then the best choice is to use a module with redisson, it sends your messages through\nredis. just add dependency, and initialize `PubSubMessagingService` with `RedissonPubSub`\n\n```kotlin\ndependencies {\n    implementation(\"ru.spliterash:pub-sub-messaging-types-redisson\")\n}\n```\n\n\n### Multipaper\nIf you use multipaper, you can use this\n\nPS. Dont forget shadow jar and relocate\n\n```kotlin\ndependencies {\n    implementation(\"ru.spliterash:pub-sub-messaging-types-multipaper\") {\n        exclude(\"org.apache.logging.log4j\")\n    }\n}\n```\n\nAnd after that just create service in your code\n \n```java\nMultiPaperPubSubServiceCreator.createService(...)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspliterash%2Fpubsubmessaging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspliterash%2Fpubsubmessaging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspliterash%2Fpubsubmessaging/lists"}