wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes What would be the correct choices Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "What would be the correct choices" Watch "What would be the correct choices" New topic
Author

What would be the correct choices

sopal Pal
Ranch Hand

Joined: Aug 04, 2003
Posts: 83
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


SCEA, SCBCD, SCJP1.4, OOAD-UML, OCP 9i
Sean Walker
Ranch Hand

Joined: Feb 04, 2004
Posts: 64
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 ]

Sean Walker<br />PMP, SCEA, SCWCD, SCJP
Phil Rhodes
Ranch Hand

Joined: Dec 27, 2003
Posts: 65
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 ]

A+, Network+, SCJP, SCWCD<br />preparing for SCBCD, SCEA, CompTIA I-Net+
Sean Walker
Ranch Hand

Joined: Feb 04, 2004
Posts: 64
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

Joined: Dec 27, 2003
Posts: 65
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

Joined: Aug 04, 2003
Posts: 83
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
 
GeeCON Prague 2014
 
subject: What would be the correct choices