SENDEXIT (Send Exit)

Outbound data on an IBM MQ channel does not always leave the queue manager exactly as the application formatted it. When SENDEXIT is set, the Message Channel Agent invokes your send exit program for each buffer (or according to exit rules) so the organization can wrap, compress, stamp, or log traffic before it hits TCP. That power comes with coupling: the remote queue manager almost always needs RCVEXIT logic that understands your wrapper format. Beginners troubleshooting stuck transmission queues sometimes find SENDEXIT on the SDR while the partner RCVR was rebuilt without RCVEXIT during a migration—messages never commit correctly and channels cycle through RETRYING. This page covers SENDEXIT definition syntax, symmetric design with RCVEXIT, interaction with batching attributes, differences from TLS and SCYEXIT, client-channel considerations, and operational discipline for exit upgrades.

The Outbound Data Path

Applications MQPUT to local or remote queues. For remote destinations, messages land on a transmission queue; the sender channel reads them, segments into protocol buffers, optionally passes each buffer through SENDEXIT, then writes to the socket. On the far side RCVEXIT reverses the transform before messages become local puts. Exits see binary data, not COBOL copybooks or JSON—translation between business format and wire format stays in applications unless your exit explicitly parses payloads (discouraged for performance and fragility).

SENDEXIT vs related mechanisms
MechanismWhen it runsIndustry standard?
SENDEXITMCA outbound bufferCustom site or vendor
TLS (SSLCIPH)TCP connect handshakeYes (TLS)
SCYEXITSecurity checkpointsCustom
Application encryptBefore MQPUTApplication choice

MQSC Examples

shell
1
2
3
4
5
6
7
8
DEFINE CHANNEL('HUB.TO.SPOKE') CHLTYPE(SDR) TRPTYPE(TCP) + CONNAME('spoke.corp.com(1414)') XMITQ('SPOKE.XMIT') + SENDEXIT('corpSnd(WRAP=v2)') BATCHSZ(50) DEFINE CHANNEL('HUB.TO.SPOKE') CHLTYPE(RCVR) TRPTYPE(TCP) + RCVEXIT('corpRcv(WRAP=v2)') DISPLAY CHANNEL('HUB.TO.SPOKE') SENDEXIT RCVEXIT BATCHSZ STOP CHANNEL('HUB.TO.SPOKE') START CHANNEL('HUB.TO.SPOKE')

corpSnd and corpRcv stand in for real module names from your exits directory. WRAP=v2 is user data both exits must interpret identically. BATCHSZ(50) batches up to fifty messages per buffer where supported—exit authors must handle batched buffers correctly or restrict BATCHSZ when using fragile transforms.

Design Rules for Exit Pairs

  • Version the exit data string (WRAP=v2) so both sides upgrade together.
  • Document which CHLTYPE on each queue manager carries which exit—cluster channels multiply definitions.
  • Never deploy SENDEXIT to production without partner RCVEXIT tested the same day.
  • Keep exit processing idempotent where possible; retries duplicate buffers on failure paths.
  • Log only non-sensitive metadata in exits—payload logging may violate privacy policy.

Cluster and Reply Traffic

Cluster sender channels (CLUSSDR) can carry SENDEXIT when hub-to-spoke transforms are required. Reply traffic on requester-server pairs may need SENDEXIT on the side that originates responses if responses are wrapped. Map both directions on paper: A to B and B to A may need different exit attributes. Fire-and-forget one-way feeds are simpler than request-reply with exits on both legs.

Explainer: Packing Tape Machine

SENDEXIT is the packing station that tapes and labels every box before it goes on the truck. The receiver must have instructions (RCVEXIT) to cut the tape and read the label. If you change the tape machine model without telling the receiver, the dock rejects every box.

Failure Modes

  1. Exit returns error—channel stops; XMITQ depth grows on sender.
  2. Exit expands buffer beyond limits—protocol or MAXMSGL errors.
  3. Asymmetric exit data—partner RCVEXIT expects v1, sender still on v2.
  4. Missing module—channel fails at startup with not found errors.
  5. Silent performance degradation—CPU saturation without obvious MQ reason code.

Explain Like I'm Five: SENDEXIT

SENDEXIT is a robot that changes every outgoing package before the mail truck picks it up, so the friend receiving it needs their own robot to change it back.

Practice Exercises

Exercise 1

Given SDR with SENDEXIT only, predict symptoms on RCVR with blank RCVEXIT.

Exercise 2

List attributes to DISPLAY before and after removing legacy SENDEXIT during TLS migration.

Exercise 3

Explain why BATCHSZ might be lowered when debugging a new send exit.

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. SENDEXIT runs on:

  • Outbound channel data
  • Queue MAXDEPTH only
  • DLQ only
  • JES spool

2. Compression SENDEXIT on SDR requires on RCVR:

  • Matching RCVEXIT
  • Higher LONGRTY only
  • Different channel name
  • No TRPTYPE

3. SENDEXIT blank on both sides means:

  • No send/receive exit transform
  • No TCP
  • No MCAUSER
  • No messages

4. SENDEXIT impact on performance:

  • Adds CPU per buffer
  • Removes network
  • Sets DEFPSIST
  • Changes CHLTYPE
Published
Read time17 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation