Inq or Priorityq based on a DTO property value

I’m using the Publish() method of JsonServiceClient to send a DTO to the server in the .inq queue.

This DTO has a property: Urgent true|false.

How can I state this DTO to go to mq:{DTO's name}.priorityq when Urgent=true?

I expect JsonServiceClient method PublishPriority() or some Publish() overload but I find nothing.

Thanks.

Calling Publish on any ServiceClient simply sends the message to the /oneway HTTP Endpoint which by default will publish the message to the registered MQ otherwise will execute the request with the HTTP Endpoint.

You can intercept published messages by overriding PublishMessage in your AppHost where you can decorate the MQ Message to specify a priority which will send it to the PriorityQ, e.g:

public virtual void PublishMessage<T>(IMessageProducer messageProducer, T message)
{
    if (message is IHasUrgent hasUrgent && hasUrgent.Urgent) {
        messageProducer.Publish(new Message<T>(message) { Priority = 1});        
    } else {
        messageProducer.Publish(message);
    }
}