Skip to content

Commit e61effe

Browse files
authored
feat: add pubsub proper registrations (#3957)
Signed-off-by: Samantha Coyle <[email protected]>
1 parent 9c9e376 commit e61effe

File tree

5 files changed

+450
-0
lines changed

5 files changed

+450
-0
lines changed

pubsub/jetstream/metadata.yaml

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# yaml-language-server: $schema=../../../component-metadata-schema.json
2+
schemaVersion: v1
3+
type: pubsub
4+
name: jetstream
5+
version: v1
6+
status: beta
7+
title: "JetStream"
8+
urls:
9+
- title: Reference
10+
url: https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-jetstream/
11+
authenticationProfiles:
12+
- title: "Basic Authentication"
13+
description: "Connect to NATS JetStream without authentication."
14+
metadata:
15+
- name: natsURL
16+
type: string
17+
required: true
18+
description: The NATS server URL.
19+
example: "nats://localhost:4222"
20+
- title: "Token Authentication"
21+
description: "Connect to NATS JetStream using token authentication."
22+
metadata:
23+
- name: natsURL
24+
type: string
25+
required: true
26+
description: The NATS server URL.
27+
example: "nats://localhost:4222"
28+
- name: token
29+
type: string
30+
required: true
31+
description: The NATS authentication token.
32+
example: "auth-token"
33+
- title: "JWT Authentication"
34+
description: "Connect to NATS JetStream using JWT authentication."
35+
metadata:
36+
- name: natsURL
37+
type: string
38+
required: true
39+
description: The NATS server URL.
40+
example: "nats://localhost:4222"
41+
- name: jwt
42+
type: string
43+
required: true
44+
description: The JWT token for authentication.
45+
example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
46+
- name: seedKey
47+
type: string
48+
required: true
49+
description: The seed key for JWT authentication.
50+
example: "SUAELX7XZIRRCNOQKCXQWFN6M3EBKUTBWK6YQKL4QFLKCUQJSEZL7ZCL7KQ"
51+
- title: "TLS Authentication"
52+
description: "Connect to NATS JetStream using TLS client certificates."
53+
metadata:
54+
- name: natsURL
55+
type: string
56+
required: true
57+
description: The NATS server URL.
58+
example: "nats://localhost:4222"
59+
- name: tls_client_cert
60+
type: string
61+
required: true
62+
description: The TLS client certificate.
63+
example: |
64+
-----BEGIN CERTIFICATE-----
65+
XXX
66+
-----END CERTIFICATE-----
67+
- name: tls_client_key
68+
type: string
69+
required: true
70+
description: The TLS client private key.
71+
example: |
72+
-----BEGIN PRIVATE KEY-----
73+
XXX
74+
-----END PRIVATE KEY-----
75+
metadata:
76+
- name: name
77+
type: string
78+
required: false
79+
description: The name of the JetStream connection.
80+
example: "dapr-jetstream"
81+
default: "dapr.io - pubsub.jetstream"
82+
- name: streamName
83+
type: string
84+
required: false
85+
description: The name of the JetStream stream.
86+
example: "my-stream"
87+
- name: durableName
88+
type: string
89+
required: false
90+
description: The durable name for the consumer.
91+
example: "my-durable"
92+
- name: queueGroupName
93+
type: string
94+
required: false
95+
description: The queue group name for load balancing.
96+
example: "my-queue-group"
97+
- name: startSequence
98+
type: integer
99+
required: false
100+
description: The starting sequence number for message delivery.
101+
example: 1
102+
- name: startTime
103+
type: integer
104+
required: false
105+
description: The starting time (Unix timestamp) for message delivery.
106+
example: 1640995200
107+
default: 0
108+
- name: flowControl
109+
type: bool
110+
required: false
111+
description: Enable flow control for the consumer.
112+
example: false
113+
default: false
114+
- name: ackWait
115+
type: string
116+
required: false
117+
description: The acknowledgment wait time.
118+
example: "30s"
119+
- name: maxDeliver
120+
type: integer
121+
required: false
122+
description: The maximum number of message deliveries.
123+
example: 5
124+
- name: maxAckPending
125+
type: integer
126+
required: false
127+
description: The maximum number of unacknowledged messages.
128+
example: 100
129+
- name: replicas
130+
type: integer
131+
required: false
132+
description: The number of stream replicas.
133+
example: 3
134+
- name: memoryStorage
135+
type: bool
136+
required: false
137+
description: Use memory storage for the stream.
138+
example: false
139+
default: false
140+
- name: rateLimit
141+
type: integer
142+
required: false
143+
description: The rate limit for message consumption.
144+
example: 1000
145+
- name: heartbeat
146+
type: string
147+
required: false
148+
description: The heartbeat interval.
149+
example: "30s"
150+
- name: deliverPolicy
151+
type: string
152+
required: true
153+
description: The delivery policy (all, last, new, sequence, time).
154+
example: "all"
155+
allowedValues:
156+
- "all"
157+
- "last"
158+
- "new"
159+
- "sequence"
160+
- "time"
161+
- name: ackPolicy
162+
type: string
163+
required: false
164+
description: The acknowledgment policy.
165+
example: "explicit"
166+
allowedValues:
167+
- "explicit"
168+
- "all"
169+
- "none"
170+
default: "explicit"
171+
- name: domain
172+
type: string
173+
required: false
174+
description: The JetStream domain.
175+
example: "my-domain"
176+
- name: apiPrefix
177+
type: string
178+
required: false
179+
description: The API prefix for JetStream.
180+
example: "$JS.API"
181+
- name: concurrency
182+
type: string
183+
required: false
184+
description: The concurrency mode (single, parallel).
185+
example: "single"
186+
default: "single"
187+
- name: backOff
188+
type: array
189+
required: false
190+
description: The backoff configuration for message delivery for the consumer.
191+
example: "[1s, 2s, 4s]"
192+
- name: maxAckPending
193+
type: integer
194+
required: false
195+
description: The maximum number of unacknowledged messages for the consumer.
196+
example: 100

pubsub/kubemq/metadata.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# yaml-language-server: $schema=../../../component-metadata-schema.json
2+
schemaVersion: v1
3+
type: pubsub
4+
name: kubemq
5+
version: v1
6+
status: beta
7+
title: "KubeMQ"
8+
urls:
9+
- title: Reference
10+
url: https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-kubemq/
11+
authenticationProfiles:
12+
- title: "Token Authentication"
13+
description: "Connect to KubeMQ using an authentication token."
14+
metadata:
15+
- name: authToken
16+
type: string
17+
required: true
18+
description: The authentication token for KubeMQ.
19+
example: "auth-token"
20+
metadata:
21+
- name: address
22+
type: string
23+
required: true
24+
description: The KubeMQ server address in format host:port.
25+
example: "localhost:50000"
26+
- name: clientID
27+
type: string
28+
required: false
29+
description: The client ID for the KubeMQ connection.
30+
example: "dapr-client"
31+
- name: group
32+
type: string
33+
required: false
34+
description: The consumer group name.
35+
example: "my-group"
36+
- name: store
37+
type: bool
38+
required: false
39+
description: Whether to use KubeMQ Event Store (true) or Events (false).
40+
example: true
41+
default: true
42+
- name: disableReDelivery
43+
type: bool
44+
required: false
45+
description: Disable message re-delivery on error.
46+
example: false
47+
default: false

pubsub/rocketmq/metadata.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const (
4242
DaprQueueSelector QueueSelectorType = "dapr"
4343
)
4444

45+
// TODO: the time fields in the metadata need to be standardized on either seconds or milliseconds or minutes.
46+
// Right now, it's a mix of all three.
47+
4548
// RocketMQ Go Client Options
4649
type rocketMQMetaData struct {
4750
// rocketmq instance name, it will be registered to the broker

0 commit comments

Comments
 (0)