IBM MQ - Update topic using the alter topic command

by
Jeremy Canfield |
Updated: August 04 2022
| IBM MQ articles
The alter topic command can be used to alter a topic. In this example, the topic named TOPIC01 in the queue manager named MANAGER01 is updated to have a description of "Hello World".
AVOID TROUBLE
When a value is a string and contains one or more white spaces, the value must be wrapped in quotes. In this example, Hello World is wrapped in quotes.
echo "alter topic (TOPIC01) DESCR ('Hello World')" | runmqsc MANAGER01
If the topic is successfully altered, something like this should be displayed.
AMQ8691I: IBM MQ topic changed.
The display topic command can be used to view the configuration of the topic.
echo "display topic (TOPIC01) DESCR" | runmqsc MANAGER01
Something like this should be returned.
AMQ8633I: Display topic details.
TOPIC(TOPIC01) TYPE(LOCAL)
TOPICSTR(events/updates)
DESCR(Hello World)
CLUSTER( ) CLROUTE(DIRECT)
DURSUB(ASPARENT) PUB(ENABLED)
SUB(ENABLED) DEFPSIST(ASPARENT)
DEFPRTY(ASPARENT) DEFPRESP(ASPARENT)
ALTDATE(2019-01-07) ALTTIME(14.55.34)
PMSGDLV(ASPARENT) NPMSGDLV(ASPARENT)
PUBSCOPE(ASPARENT) SUBSCOPE(ASPARENT)
PROXYSUB(FIRSTUSE) WILDCARD(PASSTHRU)
MDURMDL( ) MNDURMDL( )
MCAST(ASPARENT) COMMINFO( )
USEDLQ(ASPARENT) CUSTOM( )
Alter multiple fields
In this example, both DESCR and PUB are updated simultaneously.
echo "alter topic (TOPIC01) DESCR ('Hello World') PUB (ENABLED)" | runmqsc MANAGER01
Did you find this article helpful?
If so, consider buying me a coffee over at