{"id":31974717,"url":"https://github.com/splitio/mparticle-audiences-batch","last_synced_at":"2025-10-14T20:20:40.820Z","repository":{"id":60142191,"uuid":"540949660","full_name":"splitio/mparticle-audiences-batch","owner":"splitio","description":"Java Http Server to accumulate MPIDs and upload them in batches to Split","archived":false,"fork":false,"pushed_at":"2022-09-26T16:14:25.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-21T14:38:29.258Z","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/splitio.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}},"created_at":"2022-09-24T19:50:17.000Z","updated_at":"2022-09-25T16:48:12.000Z","dependencies_parsed_at":"2023-01-18T22:45:28.392Z","dependency_job_id":null,"html_url":"https://github.com/splitio/mparticle-audiences-batch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/splitio/mparticle-audiences-batch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitio%2Fmparticle-audiences-batch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitio%2Fmparticle-audiences-batch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitio%2Fmparticle-audiences-batch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitio%2Fmparticle-audiences-batch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/splitio","download_url":"https://codeload.github.com/splitio/mparticle-audiences-batch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitio%2Fmparticle-audiences-batch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021032,"owners_count":26086947,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-10-14T20:20:24.015Z","updated_at":"2025-10-14T20:20:40.812Z","avatar_url":"https://github.com/splitio.png","language":"Java","readme":"# mparticle-audiences-batch\n\nThis Java server supports SSL.\n\n## What is this server?\n\nmParticle has an *audiences* feature.  Using something like Split targeting rules, an mParticle customer can define groups of users.  This is useful when an mParticle partner wants to work with an audience.  For example, Braze does marketing campaigns and can consume mParticle audiences for outreach.\n\nDozens of companies have audience integration with mParticle.\n\nSplit segments are similar to mParticle, but more static.  In order to sync audiences with mParticle, Split must have an endpoint that can receive requests to build a new segment, add and remove keys from it, and remove the segment.  That endpoint is a node.js lambda you can find here:  https://github.com/splitio/mparticle-audiences\n\nThis server is to address a performance problem.  mParticle gives keys to Split one MPID at a time.  Thus, Split was getting flooded with one off requests to change segments, creating a costly performance problem.\n\nTo address the proble, this server was created.  This Java server takes MPIDs from the lambda endpoint and caches them in memory.  At a configurable interval, the server uses a separate thread to flush any cached keys to their corresponding Split segment.  This gives control over how often each segment flush takes place.\n\nIn addition, the server has /uptime and /ping requests for maintainability. \n\n## How to Build\n\n```\ngit clone https://github.com/splitio/mparticle-audiences-batch\n\nmvn clean compile assembly:single\n\njava -jar target/audiences-0.0.1-SNAPSHOT-jar-with-dependencies.jar audiences.config\n```\n\naudiences.config is a JSON configuration file included with the repository.  You can choose the port on which the server will listen, an authorization token to weed out garbage transactions, and the rate at which MPIDs should be flushed to Split in seconds.\n\n## How the AWS lambda uses it..\n\n * api key,\n * workspace id, \n * environment id, \n * traffic type id, \n * segment name, \n * and list of MPIDs\n\n```\n{\n    \"apiToken\": \"5c3f****\",\n    \"workspaceId\": \"c02d****\",\n    \"environmentId\": \"c02f****\",\n    \"trafficTypeId\": \"5ecf****\",\n    \"verb\" : \"add\",\n    \"mpids\" : [\n        \"001\",\n        \"002\",\n        \"003\"\n    ],\n    \"segment\": \"yuki\"\n}\n```\n\nVerb can be add or delete.\n\nDesigned to be called from \n\nhttps://github.com/splitio/mparticle-audiences\n\n... a node.js lambda that is in transactional conversation with mParticle.\n\n## How it works\n\nmParticle registers a new integration endpoint, one at which the mparticle-audiences node.js lambda resides.  When mParticle asks to create a segment or delete it, the lambda can handle itself.  When mParticle asks to add or delete an MPID to a segment (it always does this one at a time), the lambda POSTs the work to this server -- mparticle-audiences-batch -- and the Java HTTPS server maintains a cache of MPIDs per segment.\n\nAt a specified interval, a batch server thread calls the Split API to add or delete MPIDs from the corresponding segment.\n\nBoth the lambda and the batch server are multi-tenant.  They can support any number of Split customers that wish to use the integration.\n\n## Configuration\n\n```\n{\n  \"port\" : 5010,\n  \"authToken\" : \"foo\",\n  \"segmentsFlushRateInSeconds\" : 10\n  \"keyFile\" : \"yourkey.jks\" \n}\n```\n\nA file with this configuration is meant to be supplied by command line path.\n\nThe auth token works like other Split servers; you must give the correct autho token or your transaction will be ignored.\n\nThe flush rate determines how often the cache will be emptied to Split.\n\nThe key file is expected in JKS format.  The one included with the source code is self-signed...  The server uses it to serve SSL.\n\n## Questions?\n\ndavid.martin@split.io\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplitio%2Fmparticle-audiences-batch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplitio%2Fmparticle-audiences-batch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplitio%2Fmparticle-audiences-batch/lists"}