1+ asyncapi : 3.0.0
2+ info :
3+ title : Adeo AsyncAPI Case Study
4+ version : " %REPLACED_BY_MAVEN%"
5+ description : >
6+ This Adeo specification illustrates how ADEO uses AsyncAPI to document some of their exchanges
7+ contact :
8+ name : AsyncAPI team
9+ email : info@asyncapi.io
10+ tags :
11+ - name : costing
12+ description : " Costing channels, used by Costing clients."
13+ servers :
14+ production :
15+ host : " prod.url:9092"
16+ protocol : kafka-secure
17+ description : Kafka PRODUCTION cluster
18+ security :
19+ - $ref : ' #/components/securitySchemes/sasl-ssl'
20+ bindings :
21+ kafka :
22+ schemaRegistryUrl : >-
23+ https://schema-registry.prod.url/
24+ staging :
25+ host : " staging.url:9092"
26+ protocol : kafka-secure
27+ description : Kafka STAGING cluster for `uat` and `preprod` environments
28+ security :
29+ - $ref : ' #/components/securitySchemes/sasl-ssl'
30+ bindings :
31+ kafka :
32+ schemaRegistryUrl : >-
33+ https://schema-registry.staging.url/
34+ dev :
35+ host : " dev.url:9092"
36+ protocol : kafka-secure
37+ description : Kafka DEV cluster for `dev` and `sit` environments
38+ security :
39+ - $ref : ' #/components/securitySchemes/sasl-ssl'
40+ bindings :
41+ kafka :
42+ schemaRegistryUrl : >-
43+ https://schema-registry.dev.url/
44+
45+ channels :
46+ costingRequest :
47+ address : " adeo-{env}-case-study-COSTING-REQUEST-{version}"
48+ description : >
49+ Use this topic to do a Costing Request to Costing product.
50+ We use the
51+ [**RecordNameStrategy**](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#subject-name-strategy)
52+ to infer the messages schema.
53+ You have to define `x-value.subject.name.strategy` to
54+ `io.confluent.kafka.serializers.subject.RecordNameStrategy` in your
55+ producer to use the schema we manage.
56+ The schema below illustrates how Costing Request messages are
57+ handled.
58+ 
59+ parameters :
60+ env :
61+ $ref : " #/components/parameters/Env"
62+ version :
63+ $ref : " #/components/parameters/Version"
64+ bindings :
65+ kafka :
66+ replicas : 3
67+ partitions : 3
68+ topicConfiguration :
69+ cleanup.policy : [ "delete" ]
70+ retention.ms : 604800000
71+ messages :
72+ costingRequest :
73+ $ref : " #/components/messages/costingRequestV1"
74+
75+
76+
77+
78+
79+ costingResponse :
80+ address : " adeo-{env}-case-study-COSTING-RESPONSE-{version}"
81+ description : >
82+ This topic is used to REPLY Costing Requests and is targeted by the
83+ `REPLY_TOPIC` header.
84+ **You must grant PUBLISH access to our `svc-ccr-app` service account.**.
85+ We use the
86+ [**RecordNameStrategy**](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#subject-name-strategy)
87+ to infer the messages schema.
88+ You have to define `key.subject.name.strategy` and
89+ `x-value.subject.name.strategy` to
90+ `io.confluent.kafka.serializers.subject.RecordNameStrategy` in your
91+ consumer.
92+ The schema below illustrates how Costing Response messages are
93+ handled.
94+ 
95+ parameters :
96+ env :
97+ $ref : " #/components/parameters/Env"
98+ version :
99+ $ref : " #/components/parameters/Version"
100+ bindings :
101+ kafka :
102+ x-key.subject.name.strategy :
103+ type : string
104+ description : >
105+ We use the RecordNameStrategy to infer the messages schema.
106+ Use
107+ `x-key.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
108+ in your consumer configuration.
109+ x-value.subject.name.strategy :
110+ type : string
111+ description : >
112+ We use the RecordNameStrategy to infer the messages schema.
113+ Use
114+ `x-value.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
115+ in your consumer configuration.
116+ messages :
117+ costingResponse :
118+ $ref : " #/components/messages/costingResponse"
119+
120+
121+
122+
123+ operations :
124+ requestCosting :
125+ action : receive
126+ channel :
127+ $ref : ' #/channels/costingRequest'
128+ reply :
129+ channel :
130+ $ref : ' #/channels/costingResponse'
131+ address :
132+ location : ' $message.header#/REPLY_TOPIC'
133+ summary : |
134+ [COSTING] Request one or more Costing calculation for any product
135+ description : >
136+ You can try a costing request using our [Conduktor producer
137+ template](https://conduktor.url)
138+ tags :
139+ - name : costing
140+ bindings :
141+ kafka :
142+ groupId :
143+ type : string
144+ description : >
145+ The groupId must be prefixed by your `svc` account, deliver by the
146+ Adeo Kafka team.
147+ This `svc` must have the write access to the topic.
148+ x-value.subject.name.strategy :
149+ type : string
150+ description : >
151+ We use the RecordNameStrategy to infer the messages schema.
152+ Use
153+ `x-value.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
154+ in your producer configuration.
155+ getCostingResponse :
156+ action : send
157+ channel :
158+ $ref : ' #/channels/costingResponse'
159+ summary : >
160+ [COSTING] Get the costing responses matching an initial Costing
161+ Request.
162+ bindings :
163+ kafka :
164+ groupId :
165+ type : string
166+ description : >
167+ The groupId must be prefixed by your `svc` account, deliver by the
168+ Adeo Kafka team.
169+ This `svc` must have the read access to the topic.
170+ tags :
171+ - name : costing
172+
173+
174+
175+
176+
177+ components :
178+ correlationIds :
179+ costingCorrelationId :
180+ description : >
181+ This correlation ID is used for message tracing and messages
182+ correlation.
183+ This correlation ID is generated at runtime based on the `REQUEST_ID`
184+ and sent to the RESPONSE message.
185+ location : $message.header#/REQUEST_ID
186+ messages :
187+ costingRequestV1 :
188+ name : CostingRequestV1
189+ title : Costing Request V1
190+ summary : Costing Request V1 inputs.
191+ tags :
192+ - name : costing
193+ correlationId :
194+ $ref : " #/components/correlationIds/costingCorrelationId"
195+ headers :
196+ type : object
197+ required :
198+ - REQUESTER_ID
199+ - REQUESTER_CODE
200+ - REQUEST_ID
201+ - REPLY_TOPIC
202+ properties :
203+ REQUEST_ID :
204+ $ref : " #/components/schemas/RequestId"
205+ REPLY_TOPIC :
206+ $ref : " #/components/schemas/ReplyTopic"
207+ REQUESTER_ID :
208+ $ref : " #/components/schemas/RequesterId"
209+ REQUESTER_CODE :
210+ $ref : " #/components/schemas/RequesterCode"
211+ payload :
212+ schemaFormat : application/vnd.apache.avro;version=1.9.0
213+ schema :
214+ $ref : " https://www.asyncapi.com/resources/casestudies/adeo/CostingRequestPayload.avsc"
215+ costingResponse :
216+ name : CostingResponse
217+ title : Costing Response
218+ summary : Costing Response ouputs.
219+ tags :
220+ - name : costing
221+ description : >
222+ Please refer to the `CostingResponseKey.avsc` schema, available on [our
223+ github
224+ project](https://github.url/).
225+ correlationId :
226+ $ref : " #/components/correlationIds/costingCorrelationId"
227+ headers :
228+ type : object
229+ properties :
230+ CALCULATION_ID :
231+ $ref : " #/components/schemas/MessageId"
232+ CORRELATION_ID :
233+ $ref : " #/components/schemas/CorrelationId"
234+ REQUEST_TIMESTAMP :
235+ type : string
236+ format : date-time
237+ description : Timestamp of the costing request
238+ CALCULATION_TIMESTAMP :
239+ type : string
240+ format : date-time
241+ description : Technical timestamp for the costing calculation
242+ bindings :
243+ kafka :
244+ key :
245+ $ref : " https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponseKey.avsc"
246+ payload :
247+ schemaFormat : application/vnd.apache.avro;version=1.9.0
248+ schema :
249+ $ref : " https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponsePayload.avsc"
250+ schemas :
251+ RequesterId :
252+ type : string
253+ description : The Costing requester service account used to produce costing request.
254+ example : svc-ecollect-app
255+ RequesterCode :
256+ type : string
257+ description : >-
258+ The Costing requester code (generally the BU Code). The requester code
259+ is useful to get the dedicated context (tenant).
260+ example : 1
261+ MessageId :
262+ type : string
263+ format : uuid
264+ description : A unique Message ID.
265+ example : 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
266+ RequestId :
267+ type : string
268+ format : uuid
269+ description : >-
270+ A unique Request ID needed to define a `CORRELATION_ID` for exchanges,
271+ which will be sent back in the Costing Responses.
272+ example : 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
273+ CorrelationId :
274+ type : string
275+ format : uuid
276+ description : >-
277+ A unique Correlation ID defined from the `REQUEST_ID` or the
278+ `MESSAGE_ID` provided in the Costing Request.
279+ example : 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
280+ BuCode :
281+ type : string
282+ description : The Business Unit code for which data are applicable.
283+ example : 1
284+ ReplyTopic :
285+ type : string
286+ description : >
287+ The Kafka topic where to send the Costing Response. This is required for
288+ the [Return Address EIP
289+ pattern](https://www.enterpriseintegrationpatterns.com/patterns/messaging/ReturnAddress.html).
290+ **You must grant WRITE access to our `svc-ccr-app` service account.**
291+ example : adeo-case-study-COSTING-RESPONSE-V1
292+ ErrorStep :
293+ type : string
294+ description : |
295+ The woker that has thrown the error.
296+ example : EXPOSE_RESULT
297+ ErrorMessage :
298+ type : string
299+ description : |
300+ The error message describing the error.
301+ example : Error message
302+ ErrorCode :
303+ type : string
304+ description : |
305+ The error code.
306+ example : CURRENCY_NOT_FOUND
307+ parameters :
308+ Env :
309+ description : Adeo Kafka Environement for messages publications.
310+ enum :
311+ - dev
312+ - sit
313+ - uat1
314+ - preprod
315+ - prod
316+ Version :
317+ description : the topic version you want to use
318+ examples :
319+ - V1
320+ default : V1
321+ securitySchemes :
322+ sasl-ssl :
323+ type : plain
324+ x-sasl.jaas.config : >-
325+ org.apache.kafka.common.security.plain.PlainLoginModule required
326+ username="<CLUSTER_API_KEY>" password="<CLUSTER_API_SECRET>";
327+ x-security.protocol : SASL_SSL
328+ x-ssl.endpoint.identification.algorithm : https
329+ x-sasl.mechanism : PLAIN
330+ description : >
331+ Use [SASL authentication with SSL
332+ encryption](https://docs.confluent.io/platform/current/security/security_tutorial.html#configure-clients)
333+ to connect to the ADEO Broker.
0 commit comments