Skip to content

Commit

Permalink
fix kafka test
Browse files Browse the repository at this point in the history
  • Loading branch information
oviecodes committed Jan 18, 2024
1 parent 72279a1 commit a697bd9
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
99 changes: 99 additions & 0 deletions examples/kafka-test/docs/asyncapi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Kafka test 1 documentation


## Table of Contents

* [Servers](#servers)
* [mykafka](#mykafka-server)

## Servers

### `mykafka` Server

* URL: `kafka-secure://kafka://pkc-6ojv2.us-west4.gcp.confluent.cloud:9092/`
* Protocol: `kafka-secure`


#### Security

##### Security Requirement 1

* Type: `ScramSha256`
* security.protocol: SASL_SSL
* sasl.mechanism: SCRAM-SHA-256




##### Security Requirement 2

* Type: `ScramSha256`
* security.protocol: SASL_SSL
* sasl.mechanism: SCRAM-SHA-256







## Operations

### REQUEST `undefined` Operation

*Publish messages to Test channel.*

* Operation ID: `onTest`

#### Message `testMessage`

##### Payload

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | object | - | - | - | **additional properties are allowed** |
| test | string | - | - | - | - |

> Examples of payload _(generated)_
```json
{
"test": "string"
}
```


#### Request information

* should be done to channel: ``
#### Operation reply address information

* Operation reply address location: `$message.header#/replyTo`



### RECEIVE `undefined` Operation

*Recieve messages from Produce channel.*

* Operation ID: `onProduce`

#### Message `produceMessage`

##### Payload

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | object | - | - | - | **additional properties are allowed** |
| test | string | - | - | - | - |

> Examples of payload _(generated)_
```json
{
"test": "string"
}
```



6 changes: 6 additions & 0 deletions src/adapters/kafka/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import Adapter from '../../lib/adapter.js'
import GleeMessage from '../../lib/message.js'
import { KafkaAdapterConfig, KafkaAuthConfig } from '../../lib/index.js'

enum SECURITY_TYPES {
USER_PASSWORD = 'userPassword',
SCRAM_SHA_256 = 'scramSha256',
SCRAM_SHA_512 = 'scramSha512',
}

class KafkaAdapter extends Adapter {
private kafka: Kafka
private firstConnect = true
Expand Down

0 comments on commit a697bd9

Please sign in to comment.