• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

What would be the correct choices

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I recently ran into this question from WhizLabs. I am not sure why the correct answers mentioned by them is so.
Any help is appreciated.
Q : Which 2 of the following choices correctly describe the behaviour of the Publish/Subscribe and PTP messaging
Allowable choices
1. Pub/Sub is a message queue system
2. Pub/Sub is 1 sender, 1 receiver
3. PTP - N Senders and 1 receiver
4. Pub/Sub - 1 Sender and n Receiver
5. PTP is a message queue system
6. PTP - 1 sender and 1 receiver
My Choice
3, 5
Correct Answer - 4,6
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't looked at JMS recently, but I'll take a shot at answering this.

Q : Which 2 of the following choices correctly describe the behaviour of the Publish/Subscribe and PTP messaging
Allowable choices
1. Pub/Sub is a message queue system
2. Pub/Sub is 1 sender, 1 receiver
3. PTP - N Senders and 1 receiver
4. Pub/Sub - 1 Sender and n Receiver
5. PTP is a message queue system
6. PTP - 1 sender and 1 receiver


1. False - Pub/Sub is a broadcast mechanism and so is not a 'queue'
2. False - Pub/Sub is a broadcast mechanism and so is not 1 to 1
3. False - This is a little confusing because any given message may only be recieved by a single receiver, but you can have more than one receiver defined for the queue. (This can be used as a way to implement a load balancing behaviour between consumers) So anyway, on a per message basis, I believe this 3 is incorrect.
4. Correct - Any given message has only one sender and many possible consumers in Pub/Sub
5. Not sure why this is incorrect. Perhaps it is because PTP is a messaging model and a queue is only one possible way of implementing it...
6. Correct - Any given message has only one sender and only one consumer in PTP
I hope I recall mym MOM material correctly, and that this has been helpful.
[ February 06, 2004: Message edited by: Sean Walker ]
[ February 06, 2004: Message edited by: Sean Walker ]
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's my take on it...


Q : Which 2 of the following choices correctly describe the behaviour of the Publish/Subscribe and PTP messaging
Allowable choices
1. Pub/Sub is a message queue system
2. Pub/Sub is 1 sender, 1 receiver
3. PTP - N Senders and 1 receiver
4. Pub/Sub - 1 Sender and n Receiver
5. PTP is a message queue system
6. PTP - 1 sender and 1 receiver


1 - clearly false, Pub/Sub is based on Topics, not Queues
2 - clearly false, Pub/Sub is fundamentally based on multiple receivers
3 - questionable, but I'd say it's true. More than one sender can send to a given Queue, which will (usually) have only one receiver.
4 - questionable, but I'd say false, since you can, again, have more than one sender sending to a given Topic
5 - clearly true
6 - questionable, but I'd say false, since you can have more than 1 sender ending to a given Topic.
So, my answer to this question would be the same as the original posters, 3 and 5.
Some of this is questionable though.. for example, take 3.. you CAN have more than one receiver for a given Queue, but (under JMS anyway) what happens when you do that is implementation specific. SOME providers will deliver the Message to different receivers in a round-robin fashion, some will deliver it to ALL receivers, some might not deliver anything at all in that situation. The point is, that behavior isn't defined by the spec, so I'd expect that on a Sun exam, they would take the point of view that there is only one receiver for a Queue.
It also depends on some assumptions you make about what the question is really asking. Sean, in his response, is assuming it means on a per-message basis... which might be the case, but it might not. If you look at it on a more general level (which is my default way of looking at it), then the supposedly "correct" answers aren't so certain...
[ February 06, 2004: Message edited by: Phil Rhodes ]
 
Sean Walker
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the point to take note of is that the question relates to the 'messaging' models of PTP and Pub/Sub not the messaging resource (I have forgotten the generic JMS term used for both queues and topics). Therefor, I believe you should interpret the questions on a per message basis, not on a per topic or queue basis.
Put another way, when the question asks about the cardinality of producers and consumers, I believe the context is at the message level. So, while both topics and queues support multiple producers, PTP and Pub/Sub messages do not. And while both PTPO and Pub/Sub allow for multiple consumers per messaging resource, only Pub/Sub allows for a given message to be consumed by more than one receiver.
 
Phil Rhodes
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I think the point to take note of is that the question relates to the 'messaging' models of PTP and Pub/Sub not the messaging resource (I have forgotten the generic JMS term used for both queues and topics).


Destination


Put another way, when the question asks about the cardinality of producers and consumers, I believe the context is at the message level. So, while both topics and queues support multiple producers, PTP and Pub/Sub messages do not. And while both PTPO and Pub/Sub allow for multiple consumers per messaging resource, only Pub/Sub allows for a given message to be consumed by more than one receiver.


Given what they're stating as the correct answer, you must be right. It's not at all clear from the question itself that that is the case, however...
This just goes to show one of the weaknesses in tests like this... you can know the material well, but still "miss" a question because you were working off a different assumption than whoever wrote the question! <sigh>
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I agree, that the question is a little ambiguous.
But, I think I erred a little in not thinking about the answer from a single message point of view.
for a PTP messaging, 1 message can finally be consumed by only 1 user.
Thanks for time and help
Sumit
 
reply
    Bookmark Topic Watch Topic
  • New Topic