Listener Processes

Before a Java client can MQCONN over the network or a sender channel can reach your hub, something on the queue manager host must be listening on a port. That role belongs to the listener process: a companion to the queue manager that opens sockets, accepts TCP (or other transport) handshakes, and delegates to MQ connection handling. Without it, CONNAME resolves but nothing answers—operators see 2059 connection errors and channels stuck in RETRY. This tutorial explains how listener processes relate to LISTENER objects, how they differ from channel initiators, startup and security considerations, and troubleshooting patterns for beginners moving from single-machine labs to distributed estates.

Process vs Object

IBM MQ separates definition from runtime. DEFINE LISTENER(LISTENER.TCP) TRPTYPE(TCP) PORT(1414) stores intent in the repository. START LISTENER(LISTENER.TCP) asks the queue manager to spawn or activate the listener process bound to that definition. STOP LISTENER ends the process; the definition remains for next start. Multiple LISTENER objects can exist on one queue manager—different ports for administration, clients, or segregated networks—each with its own process when started.

Common LISTENER attributes beginners configure
AttributePurpose
TRPTYPE(TCP)Use TCP/IP (most common on distributed)
PORT(1414)TCP port clients and channels connect to
IPADDRBind to specific NIC; blank often means all interfaces
CONTROL(QMGR)Queue manager starts/stops with QMGR (optional)
LUNAMEFor LU6.2 transports on some platforms

Explainer: Connection Flow

A remote sender channel specifies CONNAME(host.example.com(1414)). TCP SYN arrives at the host firewall; if allowed, the listener process accepts. MQ negotiates channel type (SDR meets RCVR, or SVRCONN for clients). TLS may wrap the socket if SSLCIPH is set on the channel and certificates are in place. The listener itself does not authenticate users—that happens via CONNAUTH, CHLAUTH, and OAM after the pipe exists. Think of the listener as the building door; security desks are farther inside.

Listeners vs Channel Initiators

Message channels use channel initiators to move messages from transmission queues; listeners accept inbound network attachments. Both are queue manager processes but serve different traffic. A common mistake is START CHANNEL on the remote side while the local listener is STOPPED— the channel cannot bind. DISPLAY LSSTATUS and DISPLAY CHSTATUS together tell the story during incidents.

Startup and Automation

Queue managers often start a default listener at strmqm if configured with CONTROL(QMGR) or through ini service stanzas. Production runbooks explicitly START LISTENER after maintenance. Kubernetes and VM images may expose port 1414 via Service objects mapping to container listeners. Document which listener name maps to which external load balancer VIP so channel CONNAME updates stay traceable.

Security and Network

  • Restrict firewall source IPs to known partners where possible.
  • Use TLS on SVRCONN and message channels for encryption and identity.
  • Separate admin listeners from high-volume application listeners on different ports.
  • Monitor failed connection attempts in AMQERR and security events.

Tutorial: Define and Start a TCP Listener

shell
1
2
3
4
5
6
7
8
9
DEFINE LISTENER('LISTENER.TCP') TRPTYPE(TCP) PORT(1414) + CONTROL(QMGR) DESCR('Default TCP listener') REPLACE START LISTENER('LISTENER.TCP') DISPLAY LSSTATUS('LISTENER.TCP') ALL * Client channel uses same host/port in CONNAME or CCDT DEFINE CHANNEL('CLIENT.CONN') CHLTYPE(SVRCONN) REPLACE DEFINE CHANNEL('TO.PARTNER') CHLTYPE(SDR) + CONNAME('partner.example.com(1414)') XMITQ('PARTNER.XMIT') REPLACE

Explain Like I'm Five: Listener Process

The post office leaves the front door open during business hours (listener running). Delivery trucks from other towns knock on that door (TCP connect). If the door is locked (listener stopped), trucks wait in the street and honk (channel retry) until someone opens up.

Practice Exercises

Exercise 1

Channel RETRY with CONNAME correct but LSSTATUS STOPPED. What is the first fix?

Exercise 2

List three differences between listener process and command server.

Exercise 3

Design ports for PROD: clients, inter-QM channels, and admin—how many listeners?

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. Remote MQ clients over TCP need:

  • Only a topic
  • A running listener on the queue manager host
  • FTP
  • JCL

2. DEFINE LISTENER creates:

  • A repository definition
  • A message body
  • A COBOL program
  • A log file

3. CONNAME on a channel often contains:

  • Host and port matching a listener
  • MsgId only
  • CICS APPLID
  • JCL class

4. Bindings-mode connections:

  • Do not use a TCP listener
  • Require port 443 only
  • Use only DLQ
  • Are only on z/OS
Published
Read time13 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation