Wednesday, July 8, 2009

Destination(Queues & Topics) Properties-5

This post is the continuation of the Previous posts, So please read that properties also.

12. exclusive: Only Queues
It defines how the server delivers messages to queue consumers when multiple queue consumers are present. In exclusive mode, the first queue consumer receives all of the messages until the consumer fails. At that point, messages are delivered to the next consumer. The first queue consumer is the first-activated queue receiver.

With non-exclusive queues (exclusive set to false) the server distributes messages in a round-robin—one to each receiver that is ready. If any receivers are still ready to accept additional messages, the server distributes another round of messages—one to each receiver that is still ready. When none of the receivers are ready to receive more messages, the server waits until a queue receiver reports that it can accept a message. This arrangement prevents a large buildup of messages at one receiver and balances the load of incoming messages across a set of queue receivers.

13. prefetch: Only Queues
Delivering messages from the server to a client program involves two independent phases—fetch and accept:
1. The fetch phase is a two-step interaction between a MessageConsumer object (in a client program) and the server.
  • The MessageConsumer initiates the fetch phase by signalling to the server that it is ready for more messages.
  • The server responds by transferring one or more messages to the client, which stores them in the MessageConsumer object.

2. In the accept phase, client code takes a message from the MessageConsumer object.
To reduce waiting time for client programs, the MessageConsumer can prefetch messages—that is, fetch a batch of messages from the server, and hold them for client code to accept, one by one. It can improve performance by decreasing or eliminating client idle time while the server transfers a message.

Different values,
prefetch=none, disable automatic prefetching
prefetch=0, inherit from the parent or set default value which is 5prefetch=n, prefetch n number of messages from server

14. expiration
The server’s expiration property overrides expiration values set by message producers (in client programs). You can set this property for any queue and any topic.
If this property is set for a destination, then when the server delivers a message to that destination, the server replaces the producer’s expiration value with this value.


Popular Posts

  © Blogger templates The Professional Template by 2008

Back to TOP