> ## Documentation Index
> Fetch the complete documentation index at: https://docs.threadify.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Handling Notifications

> Acknowledge and handle notification errors

### Acknowledging

**You must call `notification.ack()`** to confirm processing:

<CodeGroup>
  ```javascript JavaScript theme={null}
  threadify.on('rule.violated', 'order_placed', async (notification) => {
    try {
      await processViolation(notification);
      notification.ack();  // ACK on success
    } catch (error) {
      // Don't ACK - notification redelivered after 30s (max 3 attempts)
    }
  });
  ```

  ```go Go theme={null}
  err := conn.Subscribe(ctx, "rule.violated", "order_placed", func(n *threadify.Notification) {
      err := processViolation(n)
      if err != nil {
          // Don't ACK - notification redelivered after 30s (max 3 attempts)
          return
      }
      n.Ack() // ACK on success
  })
  if err != nil {
      log.Fatal(err)
  }
  ```

  ```python Python theme={null}
  def on_violation(notification):
      try:
          process_violation(notification)
          notification.ack()  # ACK on success
      except Exception:
          # Don't ACK - notification redelivered after 30s (max 3 attempts)
          pass

  connection.subscribe("rule.violated", "order_placed", on_violation)
  ```
</CodeGroup>

### Retry Behavior

| Attempt | Delay | Action                     |
| ------- | ----- | -------------------------- |
| 1       | 0s    | Initial delivery           |
| 2       | 30s   | First retry (if no ACK)    |
| 3       | 30s   | Second retry (if no ACK)   |
| Failed  | -     | Moved to Dead Letter Queue |

### Next Steps

<CardGroup cols={2}>
  <Card title="Notification Architecture" icon="book" href="/things-to-know/notifications">
    Learn about notification internals
  </Card>

  <Card title="Getting Threads" icon="database" href="/core-concepts/data-retrieval/getting-threads">
    Query historical thread data
  </Card>
</CardGroup>
