src/go/plugin/ibm.d/protocols/pcf/README.md
This package provides a PCF (Programmable Command Format) protocol implementation for communicating with IBM MQ Queue Managers.
import "github.com/netdata/netdata/go/plugins/plugin/ibm.d/protocols/pcf"
// Create client
client := pcf.NewClient(pcf.Config{
QueueManager: "QM1",
Channel: "SYSTEM.DEF.SVRCONN",
Host: "localhost",
Port: 1414,
User: "admin",
Password: "password",
}, state)
// Connect
if err := client.Connect(); err != nil {
return err
}
defer client.Disconnect()
// Get version (cached, refreshed on reconnection)
version, edition, err := client.GetVersion()
// Get queue metrics
metrics, err := client.GetQueueMetrics("SYSTEM.DEFAULT.LOCAL.QUEUE")
// Get queue list
queues, err := client.GetQueueList()
The PCF protocol uses IBM MQ's administrative interface to query queue manager statistics and configuration. Commands are sent to the SYSTEM.ADMIN.COMMAND.QUEUE and responses are received on a temporary dynamic queue.
The protocol automatically detects connection failures and marks itself as disconnected. The framework's backoff mechanism handles reconnection attempts.
Static data like version and platform information is cached and only refreshed on reconnection, reducing overhead for frequently accessed information.