Bootstrap FreeKB - IBM MQ - Resolve "MQRC_PUBLICATION_FAILURE"
IBM MQ - Resolve "MQRC_PUBLICATION_FAILURE"

Updated:   |  IBM MQ articles

Let's say the following exception is being returned when publishing a message to IBM MQ.

JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2502' ('MQRC_PUBLICATION_FAILURE').

 

This error typically occurs when:

  • an app uses MQPUT to publish a message to a topic.
  • The PMSGDLV attribute (persistent) or NPMSGDLV attribute (non-persistent) is set to ALL
    • ASPARENT - The value will be set to ALL, ALLAVAIL or ALLDUR based on the parent setting (typically SYSTEM.BASE.TOPIC)
    • ALL - All messages must be succussfully delivered. If one or more messages are not delivered, MQRC_PUBLICATION_FAILURE may be returned.
    • ALLAVAIL - Messages will be delivered to subscribers that can consume the message. MQRC_PUBLICATION_FAILURE should not be returned.
    • ALLDUR - Messages will be delivered to durable subscribers that can consume the message. MQRC_PUBLICATION_FAILURE should not be returned.

If you have access to IBM MQ, you can use the display topic command to ensure the topic exists.

echo "display topic ('TOPIC01')" | runmqsc MANAGER01

 

Something like this should be returned.

AMQ8633I: Display topic details.
   TOPIC(TOPIC01)                          TYPE(LOCAL)
   TOPICSTR(events/updates)
   DESCR()
   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( )

 

If the topic PMSGDLV attribute (persistent) or NPMSGDLV attribute (non-persistent) is set to ALL, you may want to use the alter topic command to update these values to ASPARENT, ALLAVAIL, or ALLDUR.

echo "alter topic (TOPIC01) PMSGDLV (ALLDUR) NPMSGDLV (ALLAVAIL)" | runmqsc MANAGER01

 

The display tpstatus command can be used to check the topic attributes. Along with the PMSGDLV and NPMSGDLV attributes, it's also a good idea to see if PUB and SUB are enabled.

echo "display tpstatus ('event/updates')" | runmqsc MANAGER01

 

Something like this should be returned.

AMQ8754I: Display topic status details.
  TOPICSTR(event/updates)
  ADMIN(updates)                CLUSTER( )
  COMMINFO(SYSTEM.DEFAULT.COMMINFO.MULTICAST)
  MDURMDL(SYSTEM.DURABLE.MODEL.QUEUE)
  MNDURMDL(SYSTEM.NDURABLE.MODEL.QUEUE)
  CLROUTE(NONE)                 DEFPSIST(NO)
  DEFPRTY(0)                    DEFPRESP(SYNC)
  DURSUB(YES)                   PUB(ENABLED)
  SUB(ENABLED)                  PMSGDLV(ALLDUR)
  NPMSGDLV(ALLAVAIL)            RETAINED(NO)
  MCAST(DISABLED)               PUBCOUNT(0)
  SUBCOUNT(11)                  PUBSCOPE(ALL)
  SUBSCOPE(ALL)                 USEDLQ(YES)

 

If PMSGDLV and NPMSGDLV must remain set to ALL, MQRC_PUBLICATION_FAILURE may be returned, when delivery to one or more of the subscribers that are subscribed to the topic failed. The display sub command with the all flag can be used to get the list of subscribers that are subscribed to the topic.

echo "display sub (*) all" | runmqsc MANAGER01

 

Something like this should be returned for each subscription. In this scenario, you would have to try to determine what the issue is with the subscribers that cannot consume the messages from the topic.

   SUBID(100001)
   SUB(Subscription001)
   TOPICSTR(path/to/topic)
   TOPICOBJ( )                             DISTYPE(RESOLVED)
   DEST(SYSTEM.MANAGED.DURABLE.123456)
   DESTQMGR(MANAGER001)                    PUBAPPID( )
   SELECTOR( )                             SELTYPE(NONE)
   USERDATA(Shared Subscription)        
   PUBACCT(0000000000000000000000000000000000000000000000000000000000000000)
   DESTCORL(100001)
   DESTCLAS(MANAGED)                       DURABLE(YES)
   EXPIRY(UNLIMITED)                       PSPROP(MSGPROP)
   PUBPRTY(ASPUB)                          REQONLY(NO)
   SUBSCOPE(ALL)                           SUBLEVEL(1)
   SUBTYPE(API)                            VARUSER(ANY)
   WSCHEMA(TOPIC)                          SUBUSER(john.doe)
   CRDATE(2020-01-07)                      CRTIME(21:43:48)
   ALTDATE(2020-09-15)                     ALTTIME(00:00:24)

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 8d77b4 in the box below so that we can be sure you are a human.