A method and apparatus for migrating the session state of an original
session from a first node to a second node, such that a process,
executing in the migrated session, may enqueue and dequeue messages from
a queue of messages and experience the same behavior from the queue of
messages as if the process was enqueuing and dequeuing messages in the
original session. Advantageously, all the benefits of migrating a session
from one node to another node may be realized, even when the session
contains queuing state information that describes the state of a queue of
messages. Data that indicates how many messages one or more subscribers
have removed from the queue of messages may also be stored to preserve
proper behavior of the queue of messages for multiple subscribers when
sessions are migrated.