SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 337 | Next

Ola Bini

"Practical JRuby on Rails Web 2.0 Projects: Bringing Ruby on Rails to Java"

There are
also more specific words that are only used in connection with a specific type of destination.
A publisher is a producer for a topic, and a subscriber is a consumer for a topic. For a queue,
the producer is called a sender, and the consumer is called a receiver. You can guess the major
difference between a topic and a queue from the names of the actors. In a topic, a publisher
can publish something, and all subscribers to that topic will get that message. In the same
way, there can be more than one publisher for the same topic. A queue can also have more
than one receiver, and more than one sender. The difference is that only one receiver will
receive the same message. As seen earlier, a topic multicasts messages to all subscribers for
that topic, while a queue delivers one message at a time to receivers. This feature of queues
makes it mostly useful to have one receiver and many senders. Of course, there are situations
where more than one receiver can be considered useful too.
The Legacy System
As the previous chapter described, the LibLib system will contain several Rails servers revolving
around a central legacy system. Communication with this legacy system will go through
a JMS system, where requests are sent to a queue and responses will be published to a topic.
That means that the Rails application servers will need to keep track of a transaction ID so
they can associate a response with the corresponding request. It??™s also important to note when
reading this code that you??™ll use a MOM only for its legacy integration; you??™ll work around the
asynchronous features of it into a regular method call framework.


Pages:
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349