Add IBM MQ broker throughput collection#5463
Draft
ramonsmits wants to merge 2 commits intomasterfrom
Draft
Conversation
Implements IBrokerThroughputQuery for the IBM MQ transport so the licensing component's daily throughput collection can include IBM MQ deployments. Per-queue daily totals are aggregated from MQIAMO_GETS counters inside MQGACF_Q_STATISTICS_DATA groups in PCF statistics messages drained from SYSTEM.ADMIN.STATISTICS.QUEUE (configurable). The IBM .NET MQ client (amqmdnetstd.dll v9.4.5) does not implement MQCFGR group-parameter parsing, so a hand-rolled binary PCF parser walks the wire format directly using MQMessage.ReadInt4/ReadInt8/etc. Two settings expose multi-consumer flexibility: - IBMMQ/StatisticsQueue overrides the source queue, for setups where another tool already drains SYSTEM.ADMIN.STATISTICS.QUEUE and a forwarder or topic subscription delivers a per-consumer copy. - IBMMQ/StatisticsForwardingQueue causes ServiceControl to re-publish each consumed statistics message verbatim to a downstream queue in the same syncpoint, so a second consumer reads its own copy. When STATQ is disabled on the queue manager, ServiceControl still starts and runs; audit-based throughput collection acts as the fallback. All connection-time validation (broker reachability, STATQ enablement, stats-queue access) is deferred to TestConnectionCore and the first GatherThroughput cycle so InitializeCore does not block on broker I/O during host startup. Verified by 9 unit tests and 3 integration tests against a real IBM MQ broker (Podman icr.io/ibm-messaging/mq:latest). The trailing-newline removals on ConnectionProperties.cs, DeadLetterQueueCheck.cs and QueueLengthProvider.cs are an incidental side effect of running dotnet format over the project to satisfy the .editorconfig setting insert_final_newline = false.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IBrokerThroughputQueryfor the IBM MQ transport so the licensing component's daily throughput collection covers IBM MQ deployments. Statistics are read fromSYSTEM.ADMIN.STATISTICS.QUEUE(configurable) and aggregated per UTC day fromMQIAMO_GETScounters insideMQGACF_Q_STATISTICS_DATAPCF groups.MQMessage.ReadInt4/ReadInt8/ReadString/SkipBytes. The IBM .NET MQ client (amqmdnetstd.dllv9.4.5) does not implementMQCFGRgroup-parameter parsing —new PCFMessage(MQMessage)throws "Unknown type" on every statistics message, so the documented .NET API can't be used.LicensingComponent/IBMMQ/StatisticsQueue— source queue override, for setups where another tool already drainsSYSTEM.ADMIN.STATISTICS.QUEUEand a forwarder, MQ topic subscription, or cluster channel delivers a per-consumer copy to a dedicated queue.LicensingComponent/IBMMQ/StatisticsForwardingQueue— when set, ServiceControl re-publishes each consumed statistics message verbatim to a downstream queue inside the same syncpoint. Mirrors NServiceBus error/audit forwarding semantics.STATQis disabled on the queue manager, ServiceControl still starts and runs; audit-based throughput collection acts as the fallback. Connection-time validation (broker reachability,STATQenablement, stats-queue access) is deferred fromInitializeCoretoTestConnectionCoreand the firstGatherThroughputcycle so host startup never blocks on broker I/O.Test plan
icr.io/ibm-messaging/mq:latest):MQIAMO_GETSTestConnectionreports an actionable error whenSTATQ(OFF)ibmmq-bridge-demoworkload using the CI-publishedpr-image