This question came up from someone who is new to MQ. it is good to find people people who are new to MQ.
As usual there is an easy answer, but some cases you need to think about.
There is no command you can use to show this information. You can find it it out using the accounting information.
Typically an application does
- MQCONN
- MQOPEN queue
- MQPUT|MQGET
- Possibly a commit
- MQCLOSE
- MQDISC
If the accounting data shows that there was a COMMIT request, and the commit took about 1 millisecond, then there is a good chance that the put or get was in syncpoint.
If gets more interesting if you have
- MQPUT of messages out of syncpoint (for example and audit trail – we got to this point. Out of syncpoint so it exists even after a rollback)
- MQPUT within syncpoint
- MQCOMMIT
If the accounting information shows one commit, you cannot tell if it was one or two messages within syncpoint.
If the message is persistent and out of syncpoint, then under the covers it does “MQPUT|MQGET – and commit this requests”. On z/OS a put or get typically take 10 microseconds, a log I/O takes about 1 ms, so if you see an MQPUT or MQGET with a long response time (1 millisecond), then it might have been a put or get of a message outside of syncpoint.
On z/OS you can also get the logging time for a put or get, so if you see the logging time for a put or get, this is a persistent message out of syncpoint.
A non persistent message does not write to the log on disk, all updates are kept in memory, so you cannot tell from the duration of the request if it was in or out of syncpoint. Best practice is that non persistent messages are usually processed out of syncpoint.
If you see persistent messages are put or got, and the commit time is microseconds, then the commit did not do disk IO, so there was no work to commit, and so the put or get was out of syncpoint.
And lastly, you may see no commit request in the accounting data. This is bad practice, as it is assuming that the MQDISC will cause a commit or roll back, so it would happen invisibly. An application should explicitly issue a commit if messages are within syncpoint.
As I said – pretty simple – but with some complexities.
One thought on “How do I tell if my puts and gets are in or out of syncpoint?”