Applications that open IBM MQ once at startup and never expect failure are fragile. Network maintenance, queue manager restart, Kubernetes pod eviction, or multi-instance failover breaks TCP under SVRCONN—and without client reconnection every instance needs a manual bounce while messages pile up on upstream systems. Modern MQ client libraries support automatic reconnect: detect MQRC_CONNECTION_BROKEN or equivalent, reissue MQCONNX using the same CCDT or connection properties, and optionally reopen queues and subscriptions. Behavior depends on connect options your developers set, whether transactions were in flight, and if CCDT still points at a live listener. This tutorial explains client reconnection for beginners separately from message channel RETRY: which options exist at a conceptual level, how heartbeats detect dead connections, pairing with HA queue managers and CCDT updates, application design for idempotency, and operations monitoring when reconnect loops fail silently.
TCP reset mid-get leaves the application with reason code 2009 connection broken or 2195 or related codes depending on call and release. Firewall idle timeout may drop silent connections until the next MQGET wakes the library. Queue manager quiesce and restart terminates all SVRCONN instances. Load balancer health check removes a backend while long-lived SHARECNV conversations still believe they are connected. Reconnection logic is the safety net—without it operations restarts hundreds of pods; with it many outages self-heal in seconds if configuration is correct.
| Aspect | Client reconnection | Channel retry |
|---|---|---|
| Scope | Application MQI session | SDR/RCVR between QMs |
| Configured via | MQCONNX reconnect options | SHORTRTY SHORTTMR |
| Ops owner | App + middleware | MQ channel ops |
| Uses CCDT | Yes on reconnect | Uses CONNAME on SDR |
IBM MQ documents reconnect-related MQCNO options for C and equivalents in Java JMS and Jakarta Messaging clients. Typical patterns include: reconnect disabled (legacy default behavior in some apps), reconnect enabled for non-transacted consumers, and reconnect that reopens objects after restore. Consult your exact client version because constant names evolved across MQ 8, 9, and container clients. Java developers set WMQConstants or Jakarta properties; C developers OR bits into MQCNO; .NET has similar connection factory flags. Missing reconnect flags is the number one reason apps do not survive brief blips despite ops providing HA queue managers.
123456# Illustrative concepts (verify against your MQ client release docs) # C: MQCNO with reconnect enabled flags on MQCONNX # Java: connection factory setClientReconnectOptions(...) # Enable automatic reconnect where supported # Combine with CCDT or client.json pointing at HA hostname # Test: bounce queue manager while consumer running
SVRCONN HBINT and client heartbeat settings exchange keepalive traffic so both ends detect vanished peers faster than waiting for the next business MQGET. Align HBINT with firewall idle timers—if the firewall drops at five minutes and HBINT is ten, false stability ends in surprise broken pipe. KAINT on channels relates to keepalive on message channels; do not confuse the attribute sets. Network teams and MQ teams should document paired values.
Multi-instance queue managers present one logical name with floating IP or shared storage. Client CCDT CONNAME should target the service name that follows the active instance, not a single physical node that might be passive. During failover, reconnecting clients hammer the listener on the new active—ensure MAXINST on SVRCONN accommodates thundering herd. Some designs list multiple connection names in JSON client definitions for try-next-host behavior—validate order and timeout with load tests.
Transacted MQ sessions complicate reconnect: in-doubt units of work may need resolution after restore. Synchronous puts inside XA with external transaction managers follow JTA or platform rules—not all reconnect options replay ambiguous transactions safely. Architects should classify workloads: read-only consumers often reconnect cleanly; financial producers in global transactions need explicit recovery procedures and reason code handling in code paths.
Client reconnection is like a mobile phone automatically redialing when the call drops, using the same contact card entry (CCDT) instead of asking you to look up the number again.
If your walkie-talkie loses signal, client reconnection tries to find your friend again on the same channel without you running back home to get a new walkie-talkie.
Write a test plan: stop queue manager for 60 seconds while a consumer with reconnect runs—what should you observe?
Compare three workloads: read-only, transacted put, XA—which needs extra recovery design?
List CCDT and SVRCONN changes needed when failover DNS switches hostname.
1. Client reconnection applies to:
2. Channel retry applies to:
3. After reconnect apps should often implement:
4. CCDT helps reconnect when: