|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Sample MQPubSubApiSample throws RC 2085 |
« View previous topic :: View next topic » |
Author |
Message
|
Vitor |
Posted: Wed May 18, 2016 8:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
RogerLacroix wrote: |
I've never created any Pub/Sub stuff, so are you saying that if I issue the following MQSC then the sample will work?
Code: |
DEFINE TOPIC('myTopicObject') TOPICSTR('/Test/Roger') |
|
RogerLacroix wrote: |
Or do I need to do something to create the topic string of '/Test/Roger' ?? |
You need to publish something.
So if we stick with the example:
Code: |
DEFINE TOPIC(WC.TEAMS) TOPICSTR('/WorldCup/Teams') DEFPSIST(YES) |
My most worthy associate can write an app that opens the object, publishes to a topic "/ManUMustDie" and that goes out as "/WorldCup/Teams/ManUMustDie". I can separately and independently produce an app that opens the same object and publishes "ArsenalTriumphant" that goes out as "WorldCup/Teams/ArsenalTriumphant" using the same topic object and the same settings without additional administrative effort.
Indeed, someone could ignore the topic object, directly publish "WorldCup/Teams/FranceFailsInFirstRound" and it would still be subject to the topic object because of the matching. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 18, 2016 8:16 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
My most worthy associate can write an app that opens the object, publishes to a topic "/ManUMustDie" and that goes out as "/WorldCup/Teams/ManUMustDie". I can separately and independently produce an app that opens the same object and publishes "ArsenalTriumphant" that goes out as "WorldCup/Teams/ArsenalTriumphant" using the same topic object and the same settings without additional administrative effort. |
That's what I meant by a point of administrative control.
Neither application knows about the "/WorldCup/Teams/" part. And a subscriber that used the same topic object wouldn't either.
Vitor wrote: |
Indeed, someone could ignore the topic object, directly publish "WorldCup/Teams/FranceFailsInFirstRound" and it would still be subject to the topic object because of the matching. |
That's what I mean by a point of authorization. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Wed May 18, 2016 8:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Simply trying to expand the example to illustrate your most valid points.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 18, 2016 8:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
Simply trying to expand the example to illustrate your most valid points.  |
Although I did mix footie and rugby...  _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Wed May 18, 2016 9:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Vitor wrote: |
Simply trying to expand the example to illustrate your most valid points.  |
Although I did mix footie and rugby...  |
The way Man U play, it doesn't matter...... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
hughson |
Posted: Wed May 18, 2016 12:33 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
RogerLacroix wrote: |
Hi,
Really!?!
The manual for MQSC Define Topic says:
Quote: |
(topic-name)
Name of the IBM MQ topic definition (see Rules for naming IBM MQ objects ). The maximum length is 48 characters.
The name must not be the same as any other topic definition currently defined on this queue manager (unless REPLACE is specified). |
It doesn't say anything about the 'topic-name' being the 'topic object'. |
It don't think any MQ objects like channels, processes, name lists etc are ever refered to as objects, but we know them as MQ objects and recognise MQRC_UNKNOWN_OBJECT return code as referring to them. The topic is just the latest MQ object to get a DEFINE command.
I realise it's new to you, but just relate it to what you already know about MQ. You understand the difference between a channel object and a channel instance, and now you find a topic object. That'll be the defined thing then
RogerLacroix wrote: |
I've never created any Pub/Sub stuff, so are you saying that if I issue the following MQSC then the sample will work?
Code: |
DEFINE TOPIC('myTopicObject') TOPICSTR('/Test/Roger') |
|
Yes.
I feel bad now. I could have saved you a week's hassle. I was going to add the define command to my original answer whenever it was but I thought it would insult your intelligence as I was sure you'd know how to do the define command once you realised that was what was missing.
RogerLacroix wrote: |
Or do I need to do something to create the topic string of '/Test/Roger' ??
Regards,
Roger Lacroix
Capitalware Inc. |
No, nothing else.
It's a shame you started with the Java sample to be honest, because the amqsput sample dosn't require you to make a topic object. Yes, you don't always need one, you can just use a topic string directly - just not the way this sample was coded. There's some discussion above about it. Perhaps your next task can be to change the Java sample to do without the topic objects.
If you haven't already been sent it by DaveWare, here's the Intoductory presentation on Pub/Sub.
https://share.confex.com/share/117/webprogram/Handout/Session9419/PubSub.pdf
Cheers
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri May 20, 2016 11:56 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
I issued the MQSC command:
Code: |
DEFINE TOPIC('myTopicObject') TOPICSTR('/Test/Roger') |
And then the sample runs just fine.
Now that my brain understands that 'topic-name' == 'topic object', the picture is getting clearly.
Yup, next week or so, I'll play around with just a 'topic string'.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|