File tree Expand file tree Collapse file tree 3 files changed +39
-9
lines changed
springwolf-examples/springwolf-kafka-example/src
main/java/io/github/stavshamir/springwolf/example Expand file tree Collapse file tree 3 files changed +39
-9
lines changed Original file line number Diff line number Diff line change 14
14
15
15
import javax .money .MonetaryAmount ;
16
16
17
- import static io .github .stavshamir .springwolf .asyncapi .scanners .channels .operationdata .annotation .KafkaAsyncOperationBinding .KafkaAsyncMessageBinding .KafkaKeyTypes .STRING_KEY ;
18
17
import static org .springframework .kafka .support .converter .AbstractJavaTypeMapper .DEFAULT_CLASSID_FIELD_NAME ;
19
18
20
19
@@ -54,9 +53,11 @@ public void receiveAnotherPayload(AnotherPayloadDto payload) {
54
53
clientId = "foo-clientId" ,
55
54
groupId = "#{'foo-groupId'}" ,
56
55
messageBinding = @ KafkaAsyncMessageBinding (
57
- keyType = STRING_KEY ,
58
- bindingVersion = "1" ,
59
- description = "Kafka Consumer Message Key"
56
+ key = @ KafkaAsyncOperationBinding .KafkaAsyncKey (
57
+ description = "Kafka Consumer Message Key" ,
58
+ example = "example-key"
59
+ ),
60
+ bindingVersion = "1"
60
61
)
61
62
)
62
63
public void receiveMonetaryAmount (MonetaryAmount payload ) {
Original file line number Diff line number Diff line change 3
3
import io .github .stavshamir .springwolf .asyncapi .scanners .channels .operationdata .annotation .AsyncOperation ;
4
4
import io .github .stavshamir .springwolf .asyncapi .scanners .channels .operationdata .annotation .AsyncPublisher ;
5
5
import io .github .stavshamir .springwolf .asyncapi .scanners .channels .operationdata .annotation .KafkaAsyncOperationBinding ;
6
+ import io .github .stavshamir .springwolf .asyncapi .scanners .channels .operationdata .annotation .KafkaAsyncOperationBinding .KafkaAsyncKey ;
6
7
import io .github .stavshamir .springwolf .asyncapi .scanners .channels .operationdata .annotation .KafkaAsyncOperationBinding .KafkaAsyncMessageBinding ;
7
8
import io .github .stavshamir .springwolf .example .dtos .ExamplePayloadDto ;
8
9
import org .springframework .beans .factory .annotation .Autowired ;
9
10
import org .springframework .kafka .core .KafkaTemplate ;
10
11
import org .springframework .stereotype .Component ;
11
12
12
- import static io .github .stavshamir .springwolf .asyncapi .scanners .channels .operationdata .annotation .KafkaAsyncOperationBinding .KafkaAsyncMessageBinding .KafkaKeyTypes .STRING_KEY ;
13
13
import static io .github .stavshamir .springwolf .example .configuration .KafkaConfiguration .PRODUCER_TOPIC ;
14
14
import static org .springframework .kafka .support .converter .AbstractJavaTypeMapper .DEFAULT_CLASSID_FIELD_NAME ;
15
15
@@ -42,9 +42,11 @@ public class ExampleProducer {
42
42
bindingVersion = "1" ,
43
43
clientId = "foo-clientId" ,
44
44
messageBinding = @ KafkaAsyncMessageBinding (
45
- keyType = STRING_KEY ,
46
- bindingVersion = "1" ,
47
- description = "Kafka Producer Message Key"
45
+ key = @ KafkaAsyncKey (
46
+ description = "Kafka Producer Message Key" ,
47
+ example = "example-key"
48
+ ),
49
+ bindingVersion = "1"
48
50
)
49
51
)
50
52
public void sendMessage (ExamplePayloadDto msg ) {
Original file line number Diff line number Diff line change 63
63
},
64
64
"headers" : {
65
65
"$ref" : " #/components/schemas/HeadersNotDocumented"
66
+ },
67
+ "bindings" : {
68
+ "kafka" : { }
66
69
}
67
70
}
68
71
},
87
90
},
88
91
"headers" : {
89
92
"$ref" : " #/components/schemas/CloudEventHeadersForAnotherPayloadDtoEndpoint"
93
+ },
94
+ "bindings" : {
95
+ "kafka" : { }
90
96
}
91
97
}, {
92
98
"name" : " io.github.stavshamir.springwolf.example.dtos.ExamplePayloadDto" ,
97
103
},
98
104
"headers" : {
99
105
"$ref" : " #/components/schemas/SpringKafkaDefaultHeaders"
106
+ },
107
+ "bindings" : {
108
+ "kafka" : {
109
+ "key" : {
110
+ "type" : " string" ,
111
+ "description" : " Kafka Producer Message Key" ,
112
+ "example" : " example-key" ,
113
+ "exampleSetFlag" : true ,
114
+ "types" : [ " string" ]
115
+ }
116
+ }
100
117
}
101
118
} ]
102
119
}
120
137
},
121
138
"headers" : {
122
139
"$ref" : " #/components/schemas/HeadersNotDocumented"
140
+ },
141
+ "bindings" : {
142
+ "kafka" : { }
123
143
}
124
144
}
125
145
},
148
168
},
149
169
"headers" : {
150
170
"$ref" : " #/components/schemas/SpringKafkaDefaultHeaders-AnotherPayloadDto"
171
+ },
172
+ "bindings" : {
173
+ "kafka" : { }
151
174
}
152
175
}, {
153
176
"name" : " io.github.stavshamir.springwolf.example.dtos.ExamplePayloadDto" ,
157
180
},
158
181
"headers" : {
159
182
"$ref" : " #/components/schemas/SpringKafkaDefaultHeaders-ExamplePayloadDto"
183
+ },
184
+ "bindings" : {
185
+ "kafka" : { }
160
186
}
161
187
}, {
162
188
"name" : " javax.money.MonetaryAmount" ,
173
199
"key" : {
174
200
"type" : " string" ,
175
201
"description" : " Kafka Consumer Message Key" ,
176
- "exampleSetFlag" : false ,
202
+ "example" : " example-key" ,
203
+ "exampleSetFlag" : true ,
177
204
"types" : [ " string" ]
178
205
},
179
206
"bindingVersion" : " 1"
You can’t perform that action at this time.
0 commit comments