RCVEXIT (Receive Exit)

Message channel agents move application payloads across TCP (or other TRPTYPE) links in protocol buffers. IBM MQ allows optional receive exits—programs named in the RCVEXIT channel attribute that inspect or modify those buffers on the inbound path before the queue manager treats them as ordinary MQ messages. Compression appliances, legacy encryption wrappers, and bespoke audit trails are historical reasons exits exist. Today many functions moved to TLS, API gateways, or application-layer encryption, but thousands of production channels still carry RCVEXIT and SENDEXIT pairs from decades-old designs. Beginners who inherit such channels must understand that blanking RCVEXIT without removing SENDEXIT on the partner breaks the link instantly. This tutorial explains RCVEXIT syntax, pairing with SENDEXIT, performance implications, differences from SCYEXIT, platform deployment, and safe troubleshooting when exits corrupt data or throttle throughput.

Where Receive Exits Run

On a sender-receiver pair, the sending MCA calls SENDEXIT before data leaves its host; the receiving MCA calls RCVEXIT after data arrives but before messages are committed to local queues. The exits see a byte stream governed by MQ internal rules—not the same API as MQPUT from an application. Programming exits requires IBM exit interface knowledge (MQCB, exit parameters, reason codes). A receive exit that expands a buffer must allocate correctly; a wrong length causes channel protocol errors that show as sequence number or conversion failures in logs, masking the true exit bug.

Exit attributes on a typical encrypted/compressed link
Queue manager sideOutbound attributeInbound attribute
Partner A (sender)SENDEXIT compressRCVEXIT (often blank on SDR)
Partner B (receiver)SENDEXIT (if reply path)RCVEXIT decompress
BothSCYEXIT optionalSCYEXIT optional

Defining and Displaying RCVEXIT

shell
1
2
3
4
5
6
7
DEFINE CHANNEL('PARTNER.DATA') CHLTYPE(RCVR) TRPTYPE(TCP) + RCVEXIT('myRcvExit(LEVEL=9)') DEFINE CHANNEL('PARTNER.DATA') CHLTYPE(SDR) TRPTYPE(TCP) + CONNAME('partner.host(1414)') XMITQ('PARTNER.XMIT') + SENDEXIT('mySndExit(LEVEL=9)') DISPLAY CHANNEL('PARTNER.DATA') RCVEXIT SENDEXIT ALTER CHANNEL('PARTNER.DATA') RCVEXIT('myRcvExit(LEVEL=9)')

The exit names and data strings must match what your exit vendor documents. LEVEL=9 is fictional configuration data passed into the exit initialization. After ALTER, recycle channel instances. On RCVR, inbound connections pick up the new exit on the next bind; active RUNNING channels may need STOP CHANNEL on both sides for a clean test.

Symmetric SENDEXIT and RCVEXIT Design

Imagine SENDEXIT wraps each buffer in an envelope with a checksum; RCVEXIT verifies the checksum and removes the envelope. If Partner A adds SENDEXIT and Partner B has no RCVEXIT, Partner B tries to parse envelopes as raw MQ protocol—failure follows. Documentation for exit products always lists required attributes on both CHLTYPE(SDR) and CHLTYPE(RCVR), or SVRCONN and CLNTCONN pairs. Version mismatches between exit builds on two queue managers are as dangerous as MQ version skew—test every maintenance window.

Performance and Capacity

Every buffer crosses user-mode exit code. CPU cost scales with message rate and buffer size. High-throughput payment rails measuring sub-millisecond latency often remove exits in favor of hardware encryption or TLS only. BATCHSZ and BATCHINT batch multiple messages per buffer, so exits run less often per message but handle larger chunks—profile both settings together. If CPU on the channel initiator spikes after enabling RCVEXIT, consider whether transformation belongs in the application instead.

RCVEXIT on Client Channels

Server connection channels can specify RCVEXIT for traffic from clients. Client connection definitions may need SENDEXIT on the workstation if the server RCVEXIT expects a transform—uncommon for beginners but seen in strict financial networks. MQIPT and similar middleware sometimes terminate TLS and apply exits at the edge, simplifying client configuration while centralizing RCVEXIT on the hub queue manager.

Explainer: Unwrapping Packages

SENDEXIT is the machine that shrink-wraps each box before the truck leaves. RCVEXIT is the machine at the receiving dock that removes the shrink wrap before boxes enter the warehouse. If you turn off the unwrap machine but trucks still deliver wrapped boxes, nothing can be shelved.

Troubleshooting Exit-Related Channel Errors

  1. Compare DISPLAY CHANNEL RCVEXIT and SENDEXIT on both queue managers in the pair.
  2. Confirm exit modules exist in the exits directory for the queue manager UID.
  3. Review error logs for abend codes or exit return codes immediately before failure.
  4. Capture a test message flow in lab with exits disabled on both sides to establish baseline.
  5. Engage exit vendor support with MQ version, platform, and channel CHLTYPE.

Explain Like I'm Five: RCVEXIT

RCVEXIT is a helper that changes each package right when it arrives, before MQ puts it on the shelf—like opening a locked case with a special key your site invented.

Practice Exercises

Exercise 1

Document a channel pair showing which side has SENDEXIT vs RCVEXIT and what each exit does in one sentence.

Exercise 2

Estimate CPU impact: 2000 msg/sec, 4 KB average, exit adds 0.1 ms per call—when is this a problem?

Exercise 3

Write a rollback plan if a new RCVEXIT build fails during production deployment.

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. RCVEXIT processes data:

  • As it arrives on the channel
  • Only at queue manager startup
  • Only in the DLQ
  • Only in COBOL compile

2. Partner SENDEXIT usually needs:

  • Matching RCVEXIT logic
  • No listener
  • Higher MAXDEPTH
  • Topic only

3. RCVEXIT vs SCYEXIT:

  • Data path vs security
  • Same attribute
  • Both set PORT
  • Both rename QMGR

4. Blank RCVEXIT means:

  • No receive exit
  • Disable TCP
  • No MCAUSER
  • No TRPTYPE
Published
Read time17 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation