| Previous | Next |
| MQ_ERROR_MACHINE_NOT_FOUND | MQ_ERROR_ILLEGAL_USER |
MQ_ERROR_ILLEGAL_SORT
Operational meaning
Applications should keep MQ_ERROR_ILLEGAL_SORT attached to the exact MSMQ call that produced it. It applies to malformed sort specification. Check duplicate columns, sort-set count, property eligibility, and order direction in MQSORTSET.
MQLocateBegin searches public queues registered in the directory; it does not enumerate arbitrary private queues. When diagnosing this result, its restriction, projection, and sort structures are translated into a directory-backed query.
The locator observes a directory snapshot beginning when MQLocateBegin is called. Newly replicated objects and properties unsupported as columns or sort keys can produce results that differ from direct queue access.
Where the condition occurs
| Subsystem | MQLocateBegin directory queries over public-queue metadata |
|---|---|
| Relevant condition | query restrictions, selected columns, and sort keys must be valid for the AD DS-backed locator |
| Code-specific focus | malformed sort specification |
Separate a malformed query structure from an AD DS availability error. Repeating the same invalid MQSORTSET or MQRESTRICTION against another domain controller will not repair it. The code-specific boundary is malformed sort specification.
Evidence to preserve
- The ad ds mode and domain identity of the caller.
- The exact property used for filtering, projection, or ordering.
- Mqrestriction, mqcolumns, and mqsortset as submitted.
Handling and recovery
Rebuild the sort set independently from the projection columns.
Nearby failures
A directory query shape error is deterministic. Switching domain controllers cannot make an unsupported column, relation, or sort key valid. Code-specific condition: malformed sort specification.
Worked example
A discovery service querying public queues encounters it. It captures the restriction/column/sort structures and validates the query before testing directory availability.
References
Looking for a different code? Search another status or error code.
