Open MHillyer opened 2 weeks ago
At a fundamental level, the operation required here is:
tenant
, campaign
and queue
There are a couple of approaches to implement the interface for this; for each of these there will a set of parameters similar to those in the bounce and suspend APIs that will be used to select matching queues.
I'm unsure about whether we should do just one of these or all of them.
kcli rebind --domain foo.com --set queue=smarthost.com
kumo.on('rebind_message', function(msg, data)
if something then
msg:set_meta('queue', data.queue)
end
end)
and via the cli:
$ kcli rebind --trigger-rebind-event --domain foo.com --data '{"queue": "smarthost.com"}'
3. Similar to 2., but instead of using an event handler that is pre-defined in the config on the running node, the handler could be passed in as a lua code fragment. This is honestly a bit scary as it is literally remote code execution, but in all three of these cases, these operations would be restricted to trusted admin IPs per the http listener
$ kcli rebind-eval --domain foo.com --data '{"queue": "smarthost.com"}' --lua '\
function(msg, data)
if something then
msg:set_meta('queue', data.queue)
end
end'
It's worth pointing out that rebind
doesn't really directly assign a pool, it just re-evaluates the scheduled queue, which in turn implies a change in egress pool
kcli rebind docs are now in the reference manual
If egress pool assignment doesn't work, users will assign to a suspended default, and they will need to command the MTA to re-assign the message to a new egress pool.