Adjusting the requests to resend messages

When a message is missing from a sequence, the Message Agent (dbremote) waits a specified number of polls before requesting that the missing message be resent. The number of polls that the Message Agent (dbremote) waits is referred to as its patience. By default, the Message Agent (dbremote) has a patience of 1.

If the Message Agent (dbremote) has a patience of 1 and it expects to receive message 6 but it receives message 7, the Message Agent (dbremote) takes no action. Instead, the Message Agent (dbremote) waits for the results of the next poll. If after the next poll, Message 6 is still missing, then the Message Agent (dbremote) issues a resend request for Message 6.

Increasing the resend patience

Suppose you have a very small polling interval, and a message system that does not preserve the order in which messages arrive. It may be common for out-of-sequence messages to arrive after two or three polls have been completed. In this example, it is recommended that you use the -rp option to increase the Message Agent (dbremote) patience so that a large number of unnecessary resend requests are not sent. The -rp option is often used in conjunction with the -rd option that sets the polling interval. See Adjusting the polling interval to check for new messages.

Example

There are two remote users, named user1 and user2, both of which run the Message Agent (dbremote) with a polling interval of 30 seconds and a patience of 3 polls. For example, they use the following command to run their Message Agents (dbremote):

dbremote -c "DSN=SQL Anywhere 11 Demo"  -rd 30s -rp 3

In the following sequence of operations, messages are marked as userX.n where X is the user name and n is the message number. For example, user1.5 is the fifth message from user1. The Message Agent (dbremote) expects messages to start at number 1 for both users.

At time 0 seconds:

  1. The Message Agent (dbremote) reads user1.1, user2.4

  2. The Message Agent (dbremote) applies user1.1

  3. The Message Agent (dbremote) patience is now user1: N/A, user2: 3, as an out of sequence message has arrived from user 2

At time 30 seconds:

  1. The Message Agent (dbremote) reads: no new messages

  2. The Message Agent (dbremote) applies: nothing

  3. The Message Agent (dbremote) patience is now user1: N/A, user2: 2

At time 60 seconds:

  1. The Message Agent (dbremote) reads: user1.3

  2. The Message Agent (dbremote) applies: no new messages

  3. The Message Agent (dbremote) patience: user1: 3, user2: 1

At time 90 seconds:

  1. The Message Agent (dbremote) reads: user1.4

  2. The Message Agent (dbremote) applies: none

  3. The Message Agent (dbremote) patience user1: 3, user2: 0

  4. The Message Agent (dbremote) issues resend to user2

When a user receives a new message, it resets the Message Agent (dbremote) patience even if that message is not the one expected.

At time 120 seconds:

  1. The Message Agent (dbremote) reads: user1.2 and user2.2

  2. The Message Agent (dbremote) applies user1.2, user1.3, user1.4, and user2.2

  3. The Message Agent (dbremote) patience user1: N/A, user2: N/A

See also