Fire-and-Forget Messaging

Fire-and-forget is the simplest IBM MQ conversation pattern: produce a message, put it on a queue or topic, commit if using syncpoint, and move on without waiting for a business reply. The name sounds careless, but in enterprise systems it is deliberate decoupling—the order service notifies shipping, audit, and analytics without blocking on each downstream system. This page explains what fire-and-forget means at the protocol and application layers, how persistence and syncpoint still matter, error visibility when no reply exists, comparison with request/reply and pub/sub, and MQSC patterns for one-way work queues beginners see on mainframe and distributed estates.

Application vs Middleware Acknowledgment

Beginners often confuse "no reply" with "no acknowledgment." MQI put operations return completion codes; persistent messages are logged before success is reported. That is middleware acknowledgment—the queue manager has the message. Application acknowledgment—payment posted, email sent—happens later when a consumer processes the message. Fire-and-forget accepts that gap: the producer trusts MQ and downstream consumers for the rest of the lifecycle.

If the producer must know business completion, use request/reply, a separate status event on a topic, or poll a database—not blocking HTTP inside the critical path unless requirements demand it.

When to Use Fire-and-Forget

  • Dispatch work to background processors (reports, image conversion, batch enrichment).
  • Emit audit or compliance events many subscribers consume.
  • Trigger notifications where latency to the user is already satisfied.
  • Load-level mainframe batch: CICS puts, batch consumer runs overnight.

Avoid assuming fire-and-forget when regulatory proof requires synchronous confirmation from the downstream system. You may still use one-way MQ plus a separate correlated status message rather than blocking RPC.

Persistence and Delivery Guarantees

One-way does not mean disposable. Payment handoff queues use DEFPSIST(YES) and syncpoint on the put. Telemetry may use non-persistent messages for speed. The fire-and-forget pattern chooses not to wait for a reply; guaranteed delivery tutorial covers how persistence and at-least-once semantics apply regardless.

Fire-and-forget configuration choices
ChoiceEffectWhen to use
Persistent put + commitSurvives QM restartBusiness data, settlements, orders
Non-persistent putFaster; may lose on crashMetrics, heartbeats, best-effort status
Syncpoint with Db2Atomic DB + messageOutbox alternative or dual commit
No syncpointMessage visible immediately on put successSimple lab tests; understand failure modes

Error Handling Without ReplyToQ

When consumers fail, messages back out or hit BOTHRESH and move to a backout queue. Unrouteable messages go to dead-letter queues (DLQ). Operations alert on DLQ depth. Producers learn of failure only if architects add failure events—for example a topic errors/payment/failed—or monitoring on queue depth and age. Designing observability up front prevents silent backlog.

Fire-and-Forget on Topics vs Queues

One-way put to a work queue targets one consumer pool. One-way publish to a topic fans out to many subscribers. Both are fire-and-forget from the publisher perspective if no reply is expected. Choose queue versus topic based on fan-out needs, not based on whether a reply exists.

Tutorial: One-Way Work Queue

shell
1
2
3
4
5
6
7
DEFINE QLOCAL('NOTIFY.OUTBOX') REPLACE + DEFPSIST(YES) MAXDEPTH(500000) + DESCR('Fire-and-forget notifications') * Producer: MQPUT with no ReplyToQ, persistent, commit * Consumer: loop MQGET, process, commit or backout ALTER QLOCAL('NOTIFY.OUTBOX') BOTHRESH(3) BOQNAME('NOTIFY.BOQ') DEFINE QLOCAL('NOTIFY.BOQ') REPLACE

Explain Like I'm Five: Fire-and-Forget

You drop a letter in the school suggestion box and walk away. You do not wait outside the box for someone to write back. Later, the principal reads letters and might act. If you needed an answer before going to recess, you would use request/reply instead—wait at your tray for a response note.

Practice Exercises

Exercise 1: Pattern Pick

Classify fire-and-forget vs request/reply: balance inquiry, audit log entry, credit limit check for checkout.

Exercise 2: Observability

List three ways producers can learn that consumers failed without using ReplyToQ.

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. Fire-and-forget implies:

  • No application reply is expected
  • Messages are always non-persistent
  • MQGET is forbidden
  • Only topics may be used

2. After a successful persistent put and commit, the producer knows:

  • The consumer finished all business logic
  • MQ accepted the message for delivery
  • The database was updated
  • The reply queue depth

3. A status email trigger is typically:

  • Request/reply to the email server
  • Fire-and-forget to a notification queue
  • Synchronous HTTP only
  • Browse-only

4. Poison message handling for fire-and-forget consumers uses:

  • ReplyToQ only
  • Backout thresholds, DLQ, or error queues
  • Disabling all gets
  • Removing MsgId
Published
Read time11 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation