---
title: Consumer
slug: data-platform/connect-platform/app-sdk-api-reference-classes-consumer
docTags: 
createdAt: 2026-08-05T20:06:33.107Z
---

[OCP App SDK](docId\:gxEU_0AA37IEZJK-uoVcT) / Consumer

# Consumer\<T>

## Type parameters

- `T` *extends* [`` `JSONEncodable` ``](docId\:G4Yx6bJIAvgv7O6_Go1tT)

## Index

### Constructors

- [constructor](<./#function Object() \{ \[native code] }>)

### Methods

- [perform](docId\:Uu00e5AC-qCQ2uuN5mLwh)

## Constructors

## constructor()

### Signature

```typescript
new Consumer<T>(): Consumer<T>;
```

### Type parameters

- `T` *extends* [`` `JSONEncodable` ``](docId\:G4Yx6bJIAvgv7O6_Go1tT)

### Returns

[`` `Consumer` ``](docId\:y55WH-gAs-0AgiRWDn3-O)\<`T`>

## Methods

### perform()

Processes a batch of messages. Consumers should process a batch of messages and return a result containing
the success or failure of batch.
A batch should be processed in a timely manner. This means the batch size needs to be
adjusted to ensure timely processing.

### Signature

```typescript
Abstract perform(batch: Batch<T>): Promise<ConsumerResult>;
```

### Parameters

| Name    | Type                                                | Description                       |
| ------- | --------------------------------------------------- | --------------------------------- |
| `batch` | [`` `Batch` ``](docId\:gDfEVUhQwhfNSTAhL2F6s)\<`T`> | The batch of messages to process. |

### Returns

`Promise`\<[`` `ConsumerResult` ``](docId\:lNdn4ehSRkiKkLb4a4SEp)>

The result of the batch processing.

Defined in: [src/app/Consumer.ts:22](https://github.com/ZaiusInc/app-sdk/blob/cd48c01/src/app/Consumer.ts#L22)
