문제

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

도움이 되었습니까?

해결책

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.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top