| Previous | Next |
| MQ_ERROR_PROV_NAME_BUFFER_TOO_SMALL | MQ_ERROR_WRITE_NOT_ALLOWED |
MQ_ERROR_ILLEGAL_OPERATION
Operational meaning
Applications should keep MQ_ERROR_ILLEGAL_OPERATION attached to the exact MSMQ call that produced it; translating it immediately to “queue error” discards the diagnostic boundary. Its diagnostic boundary is foreign queuing system does not implement the requested action. The connector boundary, not local queue state, determines support.
For MQ_ERROR_ILLEGAL_OPERATION, A foreign destination can support a smaller operation set than a native MSMQ queue. When diagnosing MQ_ERROR_ILLEGAL_OPERATION, capability should be discovered/configured at the connector boundary instead of inferred from local queue success.
When diagnosing MQ_ERROR_ILLEGAL_OPERATION, log the destination format-name form and connector identity while avoiding credentials and message payloads. In the MQ_ERROR_ILLEGAL_OPERATION path, this separates local serialization errors from foreign-system rejection.
Where to draw the boundary
| Subsystem | connector applications and messages crossing into foreign queuing systems |
|---|---|
| Decisive boundary | application-supplied routing, security, or acknowledgment fields require a connector identity and capabilities |
| Code-specific focus | foreign queuing system does not implement the requested action |
| Primary recovery rule | Use a connector-supported operation or route the workflow through a native MSMQ queue. |
When diagnosing MQ_ERROR_ILLEGAL_OPERATION, native MSMQ semantics do not guarantee that a foreign queue supports the same operation, acknowledgment, authentication, or generated-property rules. For MQ_ERROR_ILLEGAL_OPERATION, the code-specific boundary is foreign queuing system does not implement the requested action.
Evidence to preserve
- Propid_m_connector_type and all application-supplied system properties; associate it explicitly with
MQ_ERROR_ILLEGAL_OPERATION. - When diagnosing
MQ_ERROR_ILLEGAL_OPERATION, destination format-name type and foreign-system connector configuration; capture the value before cleanup or retry changes it. - In the
MQ_ERROR_ILLEGAL_OPERATIONpath, whether msmq or the connector is expected to generate each field; compare it with a known-good call using the same account and queue type. - For this
MQ_ERROR_ILLEGAL_OPERATIONresult, record the queue path or format name, local/remote placement, transactional flag, caller SID, process build, and UTC correlation ID when they apply.
For MQ_ERROR_ILLEGAL_OPERATION, log certificate thumbprints, provider names, SIDs, GUIDs, lengths, and hashes where useful, but do not log private keys, symmetric keys, credentials, or confidential message bodies.
Diagnostic sequence
- Record the unsigned HRESULT,
MQ_ERROR_ILLEGAL_OPERATION, and the native API or COM method before a framework replaces it with a generic exception. - When diagnosing
MQ_ERROR_ILLEGAL_OPERATION, capture whether MSMQ or the connector is expected to generate each field. - In the
MQ_ERROR_ILLEGAL_OPERATIONpath, capture PROPID_M_CONNECTOR_TYPE and all application-supplied system properties. - Reproduce with the smallest queue/message/property set that still returns
MQ_ERROR_ILLEGAL_OPERATION; change one precondition at a time. - For
MQ_ERROR_ILLEGAL_OPERATION, verify the postcondition after the failed call: queue existence, message presence, directory object state, transaction outcome, or generated output may differ by result. - When diagnosing
MQ_ERROR_ILLEGAL_OPERATION, apply the code-specific recovery rule: Use a connector-supported operation or route the workflow through a native MSMQ queue.
Handling and recovery
Use a connector-supported operation or route the workflow through a native MSMQ queue.
When diagnosing MQ_ERROR_ILLEGAL_OPERATION, an immediate loop around the same call is not recovery. In the MQ_ERROR_ILLEGAL_OPERATION path, define who owns cancellation, handle recreation, transaction reconciliation, and duplicate suppression before another attempt is issued.
Nearby failure boundaries
In the MQ_ERROR_ILLEGAL_OPERATION path, A locally valid MSMQ action can still be outside the capability model of the connector or foreign queuing system. The specific focus for MQ_ERROR_ILLEGAL_OPERATION remains foreign queuing system does not implement the requested action.
- In the
MQ_ERROR_ILLEGAL_OPERATIONpath, restarting MSMQ before collecting evidence can invalidate handles and erase the first useful event; it is a containment action, not a root-cause diagnosis. - For this
MQ_ERROR_ILLEGAL_OPERATIONresult, granting broad queue or certificate permissions may mask the symptom while creating a security defect. ForMQ_ERROR_ILLEGAL_OPERATION, test the exact identity and access needed by the operation.
Worked example
A bridge to a foreign queuing system encounters MQ_ERROR_ILLEGAL_OPERATION. For MQ_ERROR_ILLEGAL_OPERATION, it verifies the connector GUID and foreign-system capability before resubmitting the message. When diagnosing MQ_ERROR_ILLEGAL_OPERATION, the acceptance test then changes only the decisive precondition and confirms both the HRESULT and the actual queue/message state.
For MQ_ERROR_ILLEGAL_OPERATION, include a negative test for the nearest misleading diagnosis so monitoring and user guidance do not collapse distinct MSMQ failures into one alert.
References
- Microsoft: MSMQMessage object and message properties — source used for the
MQ_ERROR_ILLEGAL_OPERATIONanalysis. - Microsoft: MQSendMessage — source used for the
MQ_ERROR_ILLEGAL_OPERATIONanalysis. - Microsoft Open Specifications: MSMQ protocols overview — source used for the
MQ_ERROR_ILLEGAL_OPERATIONanalysis. - Microsoft: Message Queuing error and information codes — source used for the
MQ_ERROR_ILLEGAL_OPERATIONanalysis.
Looking for a different code? Search another status or error code.