Pregunta

i am using Websphere MQ 7.1. I want to create pub/sub and i need to define a topic like "DEPARTMENT" with following structure

DEPARTMENT

   ---> SUBJECT1
   ---> SUBJECT2
        |===> Minor1

eg I define the first one like this

define TOPIC(DEPARTMENT) TOPICSTR('SUBJECT1')

but i hit error when i try to define subject2

define TOPIC(DEPARTMENT) TOPICSTR('SUBJECT2')

it says "Object already exists". How to remedy. thanks

¿Fue útil?

Solución

TOPIC objects are unique. Hence the same topic object can't defined again. Topic objects are to be used for administration and topic strings for publish messages and subscribing to publications. As you are using the same DEPARTMENT object name again to define a another topic, you are getting the error.

You can do it this way:

define TOPIC(DEPSUB1) TOPICSTR('DEPARTMENT/SUBJECT1')
define TOPIC(DEPSUB2) TOPICSTR('DEPARTMENT/SUBJECT2')
define TOPIC(DEPSUB3) TOPICSTR('DEPARTMENT/SUBJECT2/Minor1')

Later for receiving publications you can use the following sample topic strings.

"#" -> Receive all publications
"DEPARTMENT/#" -> Every publication under 'DEPARTMENT' topic
"DEPARTMENT/+/Minor1" -> All publications on 'Minor1' irrespective of SUBJECTs.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top