CrossServerManager | v1.1.5 - Flexible Subscriptions

CrossServerManager v1.1.5 - Flexible Subscriptions

A Roblox module for advanced cross-server messaging, now with flexible subscription types. Supports reliable message delivery, retries, deduplication, replay, throttling, custom monitoring, and a full offline simulation mode for testing without live Roblox servers.

link: GitHub - V1nyI/roblox-cross-server-manager: A Roblox module for advanced cross-server messaging and distributed communication. Supports reliable message delivery, retries, deduplication, replay, throttling, custom monitoring.

What’s New in v1.1.5

  • Flexible Subscriptions – New subscription types added:
    • SubscribeOnce – Receive only the first message for a topic
    • SubscribeUntil(time) – Receive messages for a specified duration in seconds
  • Minor bug fixes and stability improvements

Subscription Types Example

local csm = require(path.to.CrossServerManager)
csm:Start()

-- Normal subscribe (receives all messages)
csm:Subscribe("Topic", function(data)
    print("Received data:", data, "\n")
end)

-- Subscribe once (first message only)
csm:SubscribeOnce("Topic", function(data)
    print("Received data once:", data, "\n")
end)

-- Subscribe with a timeout of 10 seconds
csm:SubscribeUntil("Topic", function(data)
    print("Received data until:", data, "\n")
end, 10)

-- Publish a message
csm:Publish("Topic", "Hello")

Features

  • Reliable cross-server messaging
  • Automatic retry with exponential backoff
  • Deduplication for safe message processing
  • Message replay for new/late servers
  • Per-message-type throttling & configuration
  • Dead-letter queue on repeated failure
  • Custom monitoring event hooks
  • Flush pending messages on server shutdown
  • Flexible subscription control (pause, resume, unsubscribe)
  • Version check and update notification
  • Rate limit awareness with degradation

Installation

  1. Copy CrossServerManager.lua into your Roblox project (ideally in ServerScriptService).
  2. Require it in your server-side script:
    local CrossServerManager = require(path.to.CrossServerManager)
    

Initialization / Starting the Module

Before using the module, you should start its internal processes.
Call :Start() as early as possible on the server (e.g., at the top of your main server script):

local CrossServerManager = require(path.to.CrossServerManager)
CrossServerManager:Start() -- Initialize

You only need to call :Start() once per server, Set Variable Debug to Enable _log()


Basic Usage

note: Set localPublish to true to publish the message only locally on the current server. This is useful for testing or when you want to avoid sending messages across servers.

-- Subscribe to a topic
local subscription = CrossServerManager:Subscribe("MyTopic", function(payload, uuid, seq, messageType)
    print("Received:", payload)
end)

-- Publish a message
local uuid, success, err = CrossServerManager:Publish("MyTopic", {data = 123}, "default", 60)

-- Pause, resume, or unsubscribe from a topic
subscription:Pause()
subscription:Resume()
subscription:Unsubscribe()

Replay Missed Messages

Replay is one of the most powerful features of this module. If your server was offline or you want to “catch up” on messages sent before joining,

use ReplayMissedMessages to process messages from a given point in time:

-- Replay all messages for "MyTopic" sent since a specific timestamp (e.g., last hour)
local oneHourAgo = os.time() - 3600
CrossServerManager:ReplayMissedMessages("MyTopic", oneHourAgo)
  • This will fetch and deliver up to the last 40 messages for the topic that were sent since the given timestamp.

  • Note: Messages must have been published with messageRetentionTime > 0 and not expired to be eligible for replay.

  • Deduplication ensures you won’t process the same message twice.
  • Useful when a new server starts or for recovering missed events.

Advanced Usage

Monitoring Events

CrossServerManager:MonitoringOn("onMessageSent", function(uuid, topic, payload, seq, messageType)
    print("Message sent:", uuid)
end)

Full API Overview

  • :Start() – Initialize module
  • :Subscribe(topic, callback) – Normal subscription
  • :SubscribeOnce(topic, callback) – Receive first message only
  • :SubscribeUntil(topic, callback, duration) – Time-limited subscription
  • :SubscribeOncePerSender(topic, callback) – One message per sender UUID
  • :Publish(topic, payload, messageType, messageRetentionTime, localPublish) – Send a message
  • :ReplayMissedMessages(topic, sinceTimestamp, [targetServer]) – Replay messages
  • :BulkPublish(messages, localBulkPublish) – Publish multiple messages
  • :FlushPendingMessages() – Flush queued messages
  • :MonitoringOn(eventName, callback) – Custom monitoring hooks
  • :Unsubscribe(topic, id) – Remove subscription
  • :GetServerId() – Current server ID
  • :SetDebugMode(enabled) – Enable debug logging
  • Offline mode only: SetMode, CreateVirtualSimulationServer, SetLimitSimulation, GetLimitStats

License

MIT - see LICENSE for details.


GitHub: V1nyI


How do you feel about this new update? (v1.1.5)
  • Useful
  • Neutral
  • Confusing
  • Bad
0 voters

Is this Module useful?
  • Yes
  • Maybe
  • No
0 voters
33 Likes

feel free to ask me anything about this module!

oops i forgot to add SetDebugMode, now it is added

Open to ideas, feel free to share any feature suggestions!

This looks really awesome!
I must ask though, what does it do better than the services roblox uses currently? Sorry, I only skimmed it and I’m not very familiar with this so I don’t really understand the power it might provide

Hello!
With MessagingService alone

  • Messages are lost if a server is offline or joins late
  • If publish fails, it’s gone forever, no retries
  • You have no way to replay old messages
  • You can’t cancel, bulk send, or throttle messages
  • There’s no built-in way to avoid duplicates

With this module:

  • Messages can be saved in MemoryStore and replayed for servers that join later (messageRetentionTime)
  • Failed messages automatically retry until delivered or marked as “dead letter”
  • You can cancel messages before they’re processed
  • Supports bulk publishing and local publishing
  • Avoids duplicates

Highlighted Features:

  • Message Replay: Never miss an event, store messages in MemoryStore and replay them for late-joining servers (messageRetentionTime)
  • Local Publish for Testing: Send messages to the same server, perfect for development, debugging, and internal events
3 Likes

Update logs, Version: “v1.0.5”

  • SetDebugMode – Enable or disable debug mode
  • :BulkPublish(messages: {{topic: string, payload: any, messageType: string, messageRetentionTime: number, localPublish: boolean}) – Publish Multiple Messages

BulkPublish

  • Publishes all messages atomically — if one fails, none are sent.

  • Supports up to 100 messages in a single batch

  • Supports both MemoryStore-based retention and local-only publish.
  • Bypasses message queue if flagged for local delivery only.
1 Like

Been cooking up a small but powerful addition for CrossServerManager, it’ll make your workflow safer, Release coming soon

CrossServerManager v1.1.0 - Now with Offline Simulation & Virtual Servers

What’s New in v1.1.0

  • Offline Mode - Test your game without Roblox backend services
  • Virtual Servers - Create simulated servers for local multi-server testing in Studio
  • Service Limit Simulation - Configure quotas for MessagingService, MemoryStoreService, and DataStoreService to match Roblox limits
  • Limit Statistics - Check usage counters in real time with GetLimitStats()
  • Offline Queue & Replay - Queue processing and message replay now work fully in offline mode
  • Targeted Replay - In offline mode, replay missed messages to a specific simulated server
  • Backward Compatible - All online mode features from v1.0.5 remain intact

Feature Comparison

Feature v1.0.5 (Old) v1.1.0 (New)
Modes Online only Online + Offline
Virtual Servers :cross_mark: :white_check_mark:
Limit Simulation :cross_mark: :white_check_mark:
Limit Stats :cross_mark: :white_check_mark:
Offline Queue :cross_mark: :white_check_mark:
Offline Replay :cross_mark: :white_check_mark:
Targeted Replay :cross_mark: :white_check_mark:
Backwards Compatibility :white_check_mark: :white_check_mark:
2 Likes

2 Likes

Module is now available at roblox creator store: https://create.roblox.com/store/asset/114422237276742/CrossServerManager

2 Likes

CrossServerManager v1.1.5 - Flexible Subscriptions

What’s New in v1.1.5

  • Flexible Subscriptions – New subscription types added:
    • SubscribeOnce – Receive only the first message for a topic
    • SubscribeUntil(time) – Receive messages for a specified duration in seconds or until an condition is met
  • Minor bug fixes and stability improvements

Subscription Types Example

local csm = require(path.to.CrossServerManager)
csm:Start()

-- Normal subscribe (receives all messages)
csm:Subscribe("Topic", function(data)
    print("Received data:", data, "\n")
end)

-- Subscribe once (first message only)
csm:SubscribeOnce("Topic", function(data)
    print("Received data once:", data, "\n")
end)

-- Subscribe with a timeout of 10 seconds
csm:SubscribeUntil("Topic", function(data)
    print("Received data until:", data, "\n")
end, 10)

-- Publish a message
csm:Publish("Topic", "Hello")
3 Likes

This is good, but what if I’m changing a variables value when it receives a message? will the module handle it?

Hi!

you are able to change a Variable inside a CSM message callback

Example

local CSM = require(path.to.CrossServerManager)

CSM:Subscribe("Test", function(payload)
	print("old payload:", payload)
	
	payload = "new payload"
	
	print("new payload:", payload)
end)

CSM:Publish("Test", "TestPayload")

Oh, alright thanks! I will probably be using this for my project.

Does this even work with buffer ??

I think, I know that buffer can be stored inside DataStore wo why not with MessagingService

It does work with MessagingService, but not with CrossServerManager. I get an error that says it’s unsupported in CrossServerManager.

at the moment, no it does not support buffer

Perfect timing LMAO, I needed a module exactly like this.