Author |
Message
|
kash3338 |
Posted: Thu Jun 28, 2012 9:43 pm Post subject: Reg Topics |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Hi,
I have few doubts on Topics:
What is the parameter to set the lifetime of a message in a topic and whats its default value? How do I control the lifetime from my message broker flow?
When is message is published to a topic, does the topic hold 'n' number of copies of the same message if it has 'n' subscribers? Or is it just a single copy of the message that all its subscribers subscribe to?
The second question arises because I have recently that its not a good practice to have too many subscribers subscribed to a single topic. What might be the reason for that? |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jun 29, 2012 4:59 am Post subject: Re: Reg Topics |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
kash3338 wrote: |
Hi,
I have few doubts on Topics:
What is the parameter to set the lifetime of a message in a topic and whats its default value? How do I control the lifetime from my message broker flow?
When is message is published to a topic, does the topic hold 'n' number of copies of the same message if it has 'n' subscribers? Or is it just a single copy of the message that all its subscribers subscribe to?
The second question arises because I have recently that its not a good practice to have too many subscribers subscribed to a single topic. What might be the reason for that? |
What, if any, research have you done to answer these questions? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
kash3338 |
Posted: Fri Jun 29, 2012 6:18 am Post subject: Re: Reg Topics |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
bruce2359 wrote: |
What, if any, research have you done to answer these questions? |
Have done some but did not get the required answers. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jun 29, 2012 7:42 am Post subject: Re: Reg Topics |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
kash3338 wrote: |
bruce2359 wrote: |
What, if any, research have you done to answer these questions? |
Have done some but did not get the required answers. |
Research the MQMD (message descriptor). One of the fields in it addresses life-time of the message. A clue: expiry. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 29, 2012 7:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Every subscriber gets every message that is published to a given topic.
That's the whole point.
To be more clear - every registered subscriber gets a copy of each message that is published when it is published.
So if you have three subscribers at publication time 1, and five subscribers at publication time 2, then three messages will be sent at time 1 and five messages sent at time 2.
What is done with these messages is entirely up to the subscriber.
Saying that it's a bad thing to have too many subscribers is the same thing as saying that it's a bad thing to have too many queues. It's only true to a very small degree. It's certainly a bad idea to only have one subscriber, just like it's a bad idea to only have one queue. |
|
Back to top |
|
 |
kash3338 |
Posted: Fri Jun 29, 2012 9:44 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Thanks mqjeff but my question was a little different, may be I was not very clear.
My question is,
1. How does this pub/sub work internally? The topic is actually a Queue which holds the message and how does it send the message to a subscriber queue?
2. Does the Topic (which actually is a Queue) to which the Publisher publishes the message has just one copy of the message irrespective of number of subscribers to it? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 29, 2012 9:56 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
1. How does this pub/sub work internally? |
That's not documented.
That means that it's none of your business how it works.
The performance reports will tell you quite a bit about how it performs, however.
kash3338 wrote: |
2. Does the Topic (which actually is a Queue) to which the Publisher publishes the message has just one copy of the message irrespective of number of subscribers to it? |
The publisher provides a single message buffer to the MQPUT.
Multiple copies of that buffer arrive at multiple queues as individual messages - one message for each subscription that matches.
You can create 10k subscriptions to the same topic that point to the same queue, and cause your queue manager (built with the default configuration) to fall over.
You can create a queue manager that will handle 10K subscriptions to 10K individual topics pointing to 10k individual queues - if you plan and design and configure and tune for it. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 29, 2012 10:02 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
kash3338 wrote: |
1. How does this pub/sub work internally? |
That's not documented.
That means that it's none of your business how it works. |
It also means that even if you find out how it works the information has no value to you because it could change at any time & no IBM document will warn you it's done so (hence undocumented).
So anything you developed / implemented based on this knowledge of how it works internally could suddenly and unexpectedly come crashing down around your ears. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kash3338 |
Posted: Fri Jun 29, 2012 10:05 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
mqjeff wrote: |
That's not documented.
That means that it's none of your business how it works.
|
For me to be working on something without knowing how it actually works looks a bit silly
So one thing is clear that the Topic queue does not hold 'n' number of copies of a message where 'n' is equal to number of registered subscribers to that topic. Is that right? |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 29, 2012 10:16 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kash3338 wrote: |
For me to be working on something without knowing how it actually works looks a bit silly |
You're presumably using some kind of electronics to post this. Do you know exactly how that works? How about the browser software you're using to view this; gone through the source code and obtained a full understanding?
You're paying IBM a very large amount of money to have them worry about how the software does what it does. You should focus your concern on what it does, and what documented aspects of the function concern you. Like avoid the queue manager destroying design my most worthy associate mentioned above. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 29, 2012 10:16 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
mqjeff wrote: |
That's not documented.
That means that it's none of your business how it works.
|
For me to be working on something without knowing how it actually works looks a bit silly |
What does the computer in your automobile do? Do you have the source code to it?
Do you feel silly driving it every day?
How does your database save it's information to the internal files it uses? How does it resolve select statements?
kash3338 wrote: |
So one thing is clear that the Topic queue does not hold 'n' number of copies of a message where 'n' is equal to number of registered subscribers to that topic. Is that right? |
Where do you see anything that says that there is anything that resembles a "topic queue"? |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jun 29, 2012 10:22 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
kash3338 wrote: |
mqjeff wrote: |
That's not documented.
That means that it's none of your business how it works.
|
For me to be working on something without knowing how it actually works looks a bit silly
So one thing is clear that the Topic queue does not hold 'n' number of copies of a message where 'n' is equal to number of registered subscribers to that topic. Is that right? |
There is a difference between how something works, and exactly how something works. IBM documents how pub/sub works. IBM does NOT document exactly how pub/sub works. You/your apps must conform to what IBM publishes. How IBM manages the internals is proprietary, and may change as IBM sees fit.
A publisher is not limited to putting one and only one message to a TOPIC.
IBM doc clearly states that publishers and subscriber are not aware of each other. Thus, you are correct in your assumption that TOPICs do not contain an instance of the message for each subscriber. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
kash3338 |
Posted: Fri Jun 29, 2012 10:23 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
mqjeff wrote: |
What does the computer in your automobile do? Do you have the source code to it?
Do you feel silly driving it every day?
How does your database save it's information to the internal files it uses? How does it resolve select statements?
|
I was expecting such a question next for sure. I leave it there and not concerned about how a topic works any more
mqjeff wrote: |
Where do you see anything that says that there is anything that resembles a "topic queue"? |
That was a typo. My question was,
So one thing is clear that the Topic does not hold 'n' number of copies of a message where 'n' is equal to number of registered subscribers to that topic. Is that right? |
|
Back to top |
|
 |
gbaddeley |
Posted: Fri Jun 29, 2012 10:26 am Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
kash3338 wrote: |
... 2. Does the Topic (which actually is a Queue) to which the Publisher publishes the message has just one copy of the message irrespective of number of subscribers to it? |
Read about Durable Subscriptions and Retained Publications in the MQ Infocenter. _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jun 29, 2012 10:31 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
I believe more general reading on pub/sub is in order. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|