# Sticky attributes

Sticky attributes are similar to regular attributes except they will be copied to any message immediately or subsequently sent as a result of the original message being processed.

These can be sent by specifying a value for `stickyAttributes`

```typescript
await bus.send(
  new ChargeCreditCard(),
  {
    stickyAttributes: {
      ip: '229.40.202.156',
      attempt: 0,
      automatic: true
    }
  }
)
```

Sticky attributes can be accessed using the `stickyAttribtues` of the second parameter of a handler.

```typescript
import { MessageAttributes } from '@node-ts/bus-messages'

await Bus.configure()
  .withHandler(
    ChargeCreditCard,
    async (_: ChargeCreditCard, { stickyAttributes }: MessageAttributes) => console.log(attributes)
  )
  .initialize()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bus.node-ts.com/guide/message-attributes/sticky-attributes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
