How to use SNS or SQS on Unreal with FlexMatch

We have currently working matchmaking done with flexmatch and we are using describematchmaking to get the status of the matchmaking ticket. I have been trying to get my head around on how to get this working with event notifications as the documentation suggests but I can’t quite get it. There doesn’t seem to be any easy way to subscribe into an SNS topic from c++ application directly? And even if there was isn’t it quite bad to get every single message on all of the clients that have subscribed to that topic? Can lambdas be used to somehow send messages to clients? If I have understood correctly sending the SNS message to the SQS queue is one way to handle this, but there doesn’t seem to be any way to subscribe into the SQS queue and the client would have to poll the messages from the queue, isn’t this as bad as polling describematchmaking?

You don’t want your clients polling directly on the SQS/SNS queue because 99.8% of the messages are not for the client; it will end up wasting a lot of resources.

Ideally you have some game service(s) that mediates your client -> GameLift interactions. Its this that should be listening to the SNS events. Clients could query, through the service, for their matching results or be notified when theres something of interest:

Some examples of this can be found in:

(I’m trying to find a more recent example that I think is clearer but for some reason my search skills are failing me today. If I find it I will post it.)

There some useful information in this other forum post: Flexmatch making, SNS notification for pc/console game

I know the GameLift team is aware that:

  • Documentation needs an update to describe how best to use the SNS topic and patterns for consumption
  • There is this gap wrt to how clients getting notifications at high # number of requests per second without requiring a lot of development effort.

For local testing you can call DescribeMatchmaking directly on your clients, but at high volume you may start hitting throttling limits as per the documentation.

1 Like