Messaging service on new servers

Good day, I can’t really figure out how to get previous events done by messaging service to work/show on new servers.

For example: I use messaging service to create a new part in all servers, but new servers made after the event wont show that part.

What are some solutions so that even new servers can see that part?

If you want to do that, I’d recommend having some sort of system that saves what you post to a DataStore and gets it when a new server is created.

Example implementation:
an :UpdateAsync be called on a DataStore to update a table containing the information you just posted and have it remove all the values before like a certain index to prevent a table from being too big.

messagingService:PostAsync(toPost)
-- data:
data:UpdateAsync("messaging",function(previous)
previous = previous or {}
table.insert(previous,toPost)
if(#previous > 100) then
table.remove(previous,1)
end
end)

Then from a new server try:

data:GetAsync("messaging")

This would allow you to save data you post to a table that would be about 100 long max. If you choose this implementation, don’t forget to implement automatic retrying because DataStores won’t always save right away.

1 Like

A similar alternative to datastores would be using one of the Memory Store data structures if you don’t need to store these messages in the long term (i.e. only reflect any changes from the last 30 minutes), which has much more flexible rate limits.

1 Like