Troubleshooting Guide: SQL Server Error 11224 – Service Broker Conversation Conflict
Why This Error Happens
Error 11224 occurs within SQL Server’s Service Broker when a message is sent to an endpoint that is already engaged in an active conversation with the same service instance, violating the single-conversation-per-dialog rule. This typically happens due to duplicate or orphaned Service Broker conversations that were not properly ended, often caused by application logic that fails to call END CONVERSATION, or by network interruptions that leave stale dialog handles active. Corrupted or mismatched Service Broker routing configurations on Windows Server 2025 can also trigger this conflict when multiple service program instances attempt to bind to the same endpoint simultaneously.
Step-by-Step Resolution Guide
Step 1: Identify Active and Orphaned Conversations
- Open SQL Server Management Studio (SSMS) and connect to the affected instance.
- Run the following query to inspect active dialogs:
SELECT * FROM sys.conversation_endpoints WHERE state NOT IN ('CD');
- Look for conversations stuck in
CO(Conversing) orDI(Disconnected Inbound) states that correspond to the reported endpoint.
Step 2: Terminate Stale Conversations
- For each problematic conversation handle identified, manually end it using:
END CONVERSATION 'conversation_handle_guid' WITH CLEANUP;
- Restart the SQL Server Service Broker service for the affected database:
ALTER DATABASE [YourDatabase] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
Step 3: Review Application-Level Conversation Handling
- Check the application code (stored procedures or external service programs) for logic that reuses conversation handles without properly closing them via
END CONVERSATION. - Ensure the application implements a single-instance listener pattern on the target queue to prevent two service program instances from binding to the same endpoint concurrently.
- Verify the Windows Server 2025 firewall and TCP/IP settings (via
netsh advfirewallor Windows Defender Firewall settings) are not causing duplicate retry attempts due to dropped acknowledgments.
Step 4: Clear and Rebuild Broker Queues if Necessary
- If stale messages persist, disable and re-enable the broker on the database:
ALTER DATABASE [YourDatabase] SET DISABLE_BROKER;
ALTER DATABASE [YourDatabase] SET ENABLE_BROKER;
- Confirm the Service Broker GUID is regenerated correctly by checking
sys.databasesfor theservice_broker_guidcolumn.
Alternative or Verification Steps
- To verify the fix, send a test message between the two services and confirm it processes without triggering Error 11224 in the SQL Server error log located at
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG. - If the issue persists, consider implementing a conversation group lock check in your application code to serialize access to the endpoint, preventing concurrent service program instances from initiating simultaneous dialogs.