sow-topn
Import the AMPS library:
import AMPS
Construct the command:
cmd = AMPS.Command(AMPS.Message.Command.SOW)
opts = AMPS.Message.Options()
opts.set_top_n("5")
# set the topic on the command
cmd.set_topic(topic)
cmd.set_options(opts)
cmd.set_order_by("/name ASC, /orderId DESC")
The command can now be used in execute or execute_async.