Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,19 @@ For v2.0.0+ examples using the new constructors (`Producer`, `Consumer`, `AdminC

You can use the `AWS_PROFILE` environment variable to specify the profile name or use the `awsProfile` option in the `SASLConfig` [object](api-docs/v2/docs/interfaces/SASLConfig.md).

17. My Azure Entra OAuth authentication fails because the token scope/audience doesn't match my broker. How can I fix that? (Note: custom scope override is only supported for Azure Entra OAuth at this point, not GCP OAuth.)

By default, the Azure Entra OAuth provider derives the scope from the broker's hostname, i.e. `https://<broker-host>/.default`. This doesn't work for every setup, for example, managed Kafka providers may expect a scope tied to an Azure App Registration's Application ID URI (e.g. `api://<app-id>/.default`) instead. You can override the derived scope with the `scope` option in the `SASLConfig` [object](api-docs/v2/docs/interfaces/SASLConfig.md):

```javascript
const saslConfig = {
algorithm: SASL_AZURE_ENTRA,
scope: "api://<your-app-registration-id>/.default",
};
```

If `scope` is left empty, the previous hostname-derived behavior is used.

</details>

## Avro Union Types
Expand Down
1 change: 1 addition & 0 deletions api-docs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export interface SASLConfig {
password: string;
algorithm: SASL_MECHANISMS;
awsProfile: string;
scope?: string;
kerberosConfig?: KerberosConfig;
}

Expand Down
14 changes: 7 additions & 7 deletions api-docs/v2/docs/classes/AdminClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Class: AdminClient

Defined in: [index.d.ts:482](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L482)
Defined in: [index.d.ts:483](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L483)

## Classdesc

Expand All @@ -31,7 +31,7 @@ adminClient.close();

> **new AdminClient**(`connectionConfig`): `AdminClient`

Defined in: [index.d.ts:483](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L483)
Defined in: [index.d.ts:484](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L484)

#### Parameters

Expand All @@ -49,7 +49,7 @@ Defined in: [index.d.ts:483](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **close**(): `void`

Defined in: [index.d.ts:488](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L488)
Defined in: [index.d.ts:489](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L489)

#### Returns

Expand All @@ -61,7 +61,7 @@ Defined in: [index.d.ts:488](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **createTopic**(`topicConfig`): `void`

Defined in: [index.d.ts:484](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L484)
Defined in: [index.d.ts:485](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L485)

#### Parameters

Expand All @@ -79,7 +79,7 @@ Defined in: [index.d.ts:484](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **deleteTopic**(`topic`): `void`

Defined in: [index.d.ts:485](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L485)
Defined in: [index.d.ts:486](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L486)

#### Parameters

Expand All @@ -97,7 +97,7 @@ Defined in: [index.d.ts:485](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **getMetadata**(`topic`): [`TopicMetadata`](../interfaces/TopicMetadata.md)

Defined in: [index.d.ts:487](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L487)
Defined in: [index.d.ts:488](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L488)

#### Parameters

Expand All @@ -115,7 +115,7 @@ Defined in: [index.d.ts:487](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **listTopics**(): [`TopicInfo`](../interfaces/TopicInfo.md)[]

Defined in: [index.d.ts:486](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L486)
Defined in: [index.d.ts:487](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L487)

#### Returns

Expand Down
12 changes: 6 additions & 6 deletions api-docs/v2/docs/classes/Connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# ~~Class: Connection~~

Defined in: [index.d.ts:494](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L494)
Defined in: [index.d.ts:495](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L495)

## Deprecated

Expand All @@ -16,7 +16,7 @@ Use `AdminClient` instead. `Connection` remains as a compatibility alias in v2.x

> **new Connection**(`connectionConfig`): `Connection`

Defined in: [index.d.ts:501](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L501)
Defined in: [index.d.ts:502](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L502)

#### Parameters

Expand All @@ -38,7 +38,7 @@ Connection configuration.

> **close**(): `void`

Defined in: [index.d.ts:527](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L527)
Defined in: [index.d.ts:528](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L528)

#### Returns

Expand All @@ -58,7 +58,7 @@ Close the connection.

> **createTopic**(`topicConfig`): `void`

Defined in: [index.d.ts:508](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L508)
Defined in: [index.d.ts:509](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L509)

#### Parameters

Expand All @@ -84,7 +84,7 @@ Create a new topic.

> **deleteTopic**(`topic`): `void`

Defined in: [index.d.ts:515](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L515)
Defined in: [index.d.ts:516](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L516)

#### Parameters

Expand All @@ -110,7 +110,7 @@ Delete a topic.

> **listTopics**(): `string`[]

Defined in: [index.d.ts:521](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L521)
Defined in: [index.d.ts:522](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L522)

#### Returns

Expand Down
16 changes: 8 additions & 8 deletions api-docs/v2/docs/classes/Consumer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Class: Consumer

Defined in: [index.d.ts:428](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L428)
Defined in: [index.d.ts:429](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L429)

## Classdesc

Expand Down Expand Up @@ -32,7 +32,7 @@ consumer.close();

> **new Consumer**(`readerConfig`): `Consumer`

Defined in: [index.d.ts:429](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L429)
Defined in: [index.d.ts:430](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L430)

#### Parameters

Expand All @@ -50,7 +50,7 @@ Defined in: [index.d.ts:429](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **close**(): `void`

Defined in: [index.d.ts:435](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L435)
Defined in: [index.d.ts:436](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L436)

#### Returns

Expand All @@ -62,7 +62,7 @@ Defined in: [index.d.ts:435](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **commitOffsets**(): `void`

Defined in: [index.d.ts:433](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L433)
Defined in: [index.d.ts:434](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L434)

#### Returns

Expand All @@ -74,7 +74,7 @@ Defined in: [index.d.ts:433](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **consume**(`consumeConfig`): [`Message`](../interfaces/Message.md)[]

Defined in: [index.d.ts:430](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L430)
Defined in: [index.d.ts:431](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L431)

#### Parameters

Expand All @@ -92,7 +92,7 @@ Defined in: [index.d.ts:430](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **position**(`partition`): `number`

Defined in: [index.d.ts:432](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L432)
Defined in: [index.d.ts:433](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L433)

#### Parameters

Expand All @@ -110,7 +110,7 @@ Defined in: [index.d.ts:432](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **seek**(`partition`, `offset`): `void`

Defined in: [index.d.ts:431](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L431)
Defined in: [index.d.ts:432](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L432)

#### Parameters

Expand All @@ -132,7 +132,7 @@ Defined in: [index.d.ts:431](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **stats**(): [`ConsumerStats`](../interfaces/ConsumerStats.md)

Defined in: [index.d.ts:434](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L434)
Defined in: [index.d.ts:435](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L435)

#### Returns

Expand Down
12 changes: 6 additions & 6 deletions api-docs/v2/docs/classes/Producer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Class: Producer

Defined in: [index.d.ts:375](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L375)
Defined in: [index.d.ts:376](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L376)

## Classdesc

Expand Down Expand Up @@ -40,7 +40,7 @@ producer.close();

> **new Producer**(`writerConfig`): `Producer`

Defined in: [index.d.ts:376](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L376)
Defined in: [index.d.ts:377](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L377)

#### Parameters

Expand All @@ -58,7 +58,7 @@ Defined in: [index.d.ts:376](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **close**(): `void`

Defined in: [index.d.ts:380](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L380)
Defined in: [index.d.ts:381](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L381)

#### Returns

Expand All @@ -70,7 +70,7 @@ Defined in: [index.d.ts:380](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **flush**(): `void`

Defined in: [index.d.ts:378](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L378)
Defined in: [index.d.ts:379](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L379)

#### Returns

Expand All @@ -82,7 +82,7 @@ Defined in: [index.d.ts:378](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **produce**(`produceConfig`): `void`

Defined in: [index.d.ts:377](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L377)
Defined in: [index.d.ts:378](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L378)

#### Parameters

Expand All @@ -100,7 +100,7 @@ Defined in: [index.d.ts:377](https://github.com/mostafa/xk6-kafka/blob/main/api-

> **stats**(): [`ProducerStats`](../interfaces/ProducerStats.md)

Defined in: [index.d.ts:379](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L379)
Defined in: [index.d.ts:380](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L380)

#### Returns

Expand Down
8 changes: 4 additions & 4 deletions api-docs/v2/docs/classes/Reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# ~~Class: Reader~~

Defined in: [index.d.ts:441](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L441)
Defined in: [index.d.ts:442](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L442)

## Deprecated

Expand All @@ -16,7 +16,7 @@ Use `Consumer` instead. `Reader` remains as a compatibility alias in v2.x.

> **new Reader**(`readerConfig`): `Reader`

Defined in: [index.d.ts:448](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L448)
Defined in: [index.d.ts:449](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L449)

#### Parameters

Expand All @@ -38,7 +38,7 @@ Reader configuration.

> **close**(): `void`

Defined in: [index.d.ts:461](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L461)
Defined in: [index.d.ts:462](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L462)

#### Returns

Expand All @@ -58,7 +58,7 @@ Close the reader.

> **consume**(`consumeConfig`): [`Message`](../interfaces/Message.md)[]

Defined in: [index.d.ts:455](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L455)
Defined in: [index.d.ts:456](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L456)

#### Parameters

Expand Down
14 changes: 7 additions & 7 deletions api-docs/v2/docs/classes/SchemaRegistry.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Class: SchemaRegistry

Defined in: [index.d.ts:582](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L582)
Defined in: [index.d.ts:583](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L583)

## Classdesc

Expand Down Expand Up @@ -65,7 +65,7 @@ writer.produce({

> **new SchemaRegistry**(`schemaRegistryConfig`): `SchemaRegistry`

Defined in: [index.d.ts:589](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L589)
Defined in: [index.d.ts:590](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L590)

#### Parameters

Expand All @@ -87,7 +87,7 @@ Schema Registry configuration.

> **createSchema**(`schema`): [`Schema`](../interfaces/Schema.md)

Defined in: [index.d.ts:603](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L603)
Defined in: [index.d.ts:604](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L604)

#### Parameters

Expand All @@ -113,7 +113,7 @@ Create or update a schema on Schema Registry.

> **deserialize**(`container`): `any`

Defined in: [index.d.ts:624](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L624)
Defined in: [index.d.ts:625](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L625)

#### Parameters

Expand All @@ -139,7 +139,7 @@ Deserializes the given data and schema into its original form.

> **getSchema**(`schema`): [`Schema`](../interfaces/Schema.md)

Defined in: [index.d.ts:596](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L596)
Defined in: [index.d.ts:597](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L597)

#### Parameters

Expand All @@ -165,7 +165,7 @@ Get a schema from Schema Registry by version and subject.

> **getSubjectName**(`subjectNameConfig`): `string`

Defined in: [index.d.ts:610](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L610)
Defined in: [index.d.ts:611](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L611)

#### Parameters

Expand All @@ -191,7 +191,7 @@ Returns the subject name for the given SubjectNameConfig.

> **serialize**(`container`): `Uint8Array`

Defined in: [index.d.ts:617](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L617)
Defined in: [index.d.ts:618](https://github.com/mostafa/xk6-kafka/blob/main/api-docs/v2/index.d.ts#L618)

#### Parameters

Expand Down
Loading
Loading