2

I want to configure IIB 10 and MQ 8 so that the published monitoring-event messages are persisted in a persistent MQ queue.

The manual at : https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ac37850_.htm has a Note to say:

Publications resolve to be nonpersistent by default, but you can change a publication to be persistent by configuring named topics in WebSphere® MQ. For more information, see the Subscriptions and message persistence topic in the WebSphere MQ Version 7.5 product documentation online.

Unfortunately, this weird ref to an old version of MQ leads nowhere.

I went through the MQ manual that defines the fields in the Topic definition in Explorer and that doesn't help, since the 'Default persistence' requires the publisher to use MQPER_PERSISTENCE_AS_Q_DEF. As IIB's default is 'not persistent', I have to assume it doesn't use this.

I'd be really grateful if someone could tell me how to override this and have persisitent messages written to a persistent queue.

FWIW I originally assumed that defining the queue to receive the event messages as persistent would do the trick - it doesn't. Next, I tried defining a topic XXX with topic string $SYS/Broker/int-sver/monitoring/+/+ with 'Default persistence' set to 'Persistent' - that doesn't work, either.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
  • @JoshMc Thanks ever so much. Solved. I learn something every day! I had an existing SUB ending with '/#'' to topic SYSTEM.BASE.TOPIC which specifies non-persistent as default. Removing the '+/+' from the new topic. which specifies 'persistent' as default, results in the published messages being persistent. I'm developing something to cconsume event messages and up to now was using direct JMS subs and the queue was a debugging aid. Now I need to also consume from a persisitent queue, so wanted to know that it can be done. If you can provide a short reply, I'll mark it as the solution. – John Ormerod Jul 24 '20 at 07:34
  • John, I added an answer with the details from my comments. Note that on the bottom of the IIB page you referenced you can click "feedback" and select "Email IBM Knowledge Center support" to send email directly to the team that maintains the KC information. I went ahead and did this and pointed them to the link I found that may be what was originally linked to. You may want to do the same as it could get more priority coming from two external sources. Good luck. – JoshMc Jul 24 '20 at 10:00

2 Answers2

2

You mentioned the docs state "Publications resolve to be nonpersistent by default", this does not mean that they use MQPER_NOT_PERSISTENT, likely they use MQPER_PERSISTENCE_AS_Q_DEF or specify nothing at all in which case it defaults to the same as if MQPER_PERSISTENCE_AS_Q_DEF was specified.

The problem is with your topic string. A TOPIC object is a anchor to a leaf in the tree. It applies to anything below that leaf unless a more specific TOPIC object applies. So in your case the string should be $SYS/Broker/int-sver/monitoring with out the /+/+ at the end.

+ is a wildcard and wildcards only come into play on subscriptions not on topics.


You can find more information in the IBM MQ v8.0 Knowledge Center page IBM MQ>Technical overview>IBM MQ objects>Object types>Topic objects:

A topic object is an IBM® MQ object that allows you to assign specific, non-default attributes to topics.

A topic is defined by an application publishing or subscribing to a particular topic string. A topic string can specify a hierarchy of topics by separating them with a forward slash character (/). This can be visualized by a topic tree. For example, if an application publishes to the topic strings /Sport/American Football and /Sport/Soccer, a topic tree will be created that has a parent node Sport with two children, American Football, and Soccer.

Topics inherit their attributes from the first parent administrative node found in their topic tree. If there are no administrative topic nodes in a particular topic tree, then all topics will inherit their attributes from the base topic object, SYSTEM.BASE.TOPIC.

You can create a topic object at any node in a topic tree by specifying that node's topic string in the TOPICSTR attribute of the topic object. You can also define other attributes for the administrative topic node. For more information about these attributes, see the The MQSC commands, or the Automating administration tasks. Each topic object will, by default, inherit its attributes from its closest parent administrative topic node.

topic objects can also be used to hide the full topic tree from application developers. If a topic object named FOOTBALL.US is created for the topic /Sport/American Football, an application can publish or subscribe to the object named FOOTBALL.US instead of the string /Sport/American Football with the same result.

If you enter a #, +, /, or * character within a topic string on a topic object, the character is treated as a normal character within the string, and is considered to be part of the topic string associated with a topic object.

For more information about topic objects, see Publish/subscribe messaging.


The closest page I could find to the link in the IIB KC on MQ v8.0 is the IBM MQ Knowledge Center page IBM MQ>Developing applications>Developing MQI applications with IBM MQ>Writing a procedural application for queuing>Writing publish/subscribe applications>Subscription options:

Message persistence --

Queue managers maintain the persistence of the publications they forward to subscribers as set by the publisher. The publisher sets the persistence to be one of the following options:

0
Nonpersistent

1
Persistent

2
Persistence as queue/topic definition

For publish/subscribe, the publisher resolves the topic object and topicString to a resolved topic object. If the publisher specifies Persistence as queue/topic definition, then the default persistence from the resolved topic object is set for the publication.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
  • Many thanks Josh. I realise that I have been lazy with topics - what I had done was sufficient for dev and test up to this point. For which I apolgise. I will study the extracts from the manual. John – John Ormerod Jul 24 '20 at 13:31
0

This article explains how to generate and subscribe to broker generated event messages. It is not in the text, but I think the generates messages are persistent.

https://www.ibm.com/developerworks/websphere/library/techarticles/0911_fan/0911_fan.html

At the subscription queue one could also set DEFPSIST(YES)

matjung
  • 173
  • 1
  • 7
  • "At the subscription queue one could also set DEFPSIST(YES)" -- This is not correct. Persistence is determined at publish time, not by the subscriber. The DEFPSIST is only a default if persistence is not set by the putting app. If persistence is not set by the putting app, the default is taken from the first queue a message is put to. For example if a put is to a qalias, the default on the target queue is ignored. For publish the default is taken from resolved admin topic object. – JoshMc Jul 28 '20 at 23:36
  • I already provided a answer to this question which the OP confirmed worked and they accepted my answer. If you just wanted to provide a link to the article that could be a comment. – JoshMc Jul 28 '20 at 23:38