Let's say my user requests my ES/CQRS system to open a support ticket:
The controller sends an ask-support command, this command checks if the user has enough credit to do that, then emits an asked-support event.
Somewhere, a listener responsible for side-effects gets this event. It calls an external support API to open a ticket and it retrieves a token from this call.
It sends an open-ticket command containing this token and this results in an opened-ticket event.
Now my controller should return the precious token to the client, but how?
With this publish/subscribe logic, my listener doesn't know the controller and can't tell him "hey, your ticket is created, here is your token".
I could have a read projection that results in a list of support tickets tokens and the controller could call it until the token appears (but that isn't great). Or somehow temporarily subscribe to the projection changes (but that's complex).
What strategy would you recommand for this case? Is my original design flawed?
Thanks