Returning a Message to the Queue

A subscriber can also explicitly release a message back to the queue. AMPS returns the message to the queue, and redelivers the message just as though the lease had expired. To do this, the subscriber sends a sow_delete command with the bookmark of the message to release and the cancel option:

client.execute(
  new Command('sow_delete')
      .topic(message.header.topic())
      .bookmark(message.header.bookmark())
      .options('cancel');
);

Last updated