Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: request/response support #847

Merged
merged 43 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ea5a6c6
#847 request reply support
Jan 18, 2023
2c13ed7
review examples and namings
Jan 18, 2023
58f03f7
Update spec/asyncapi.md
GreenRover Jan 19, 2023
9536a38
Update spec/asyncapi.md
GreenRover Jan 19, 2023
2014a17
Update spec/asyncapi.md
GreenRover Jan 19, 2023
350908f
add separated reply adress object
Jan 19, 2023
59c7d4a
spell fixes
Jan 19, 2023
091b001
Update spec/asyncapi.md
GreenRover Feb 1, 2023
1f7e4ca
Update spec/asyncapi.md
GreenRover Feb 1, 2023
ecac564
Update spec/asyncapi.md
GreenRover Feb 1, 2023
bd81a0f
delete spec variant examples
Feb 1, 2023
b48a43d
Update spec/asyncapi.md
GreenRover Feb 1, 2023
211058b
Update spec/asyncapi.md
GreenRover Feb 2, 2023
abcc028
permit replyAdress to be a component
GreenRover Feb 8, 2023
28e9bd1
permit operationReplyObject to be extendit and fix hjeadline size
GreenRover Feb 8, 2023
02554c5
Update spec/asyncapi.md
GreenRover Feb 8, 2023
cafc0dd
revert spec version change
GreenRover Feb 8, 2023
68e691e
move componentsReplyAddresses to correct location
GreenRover Feb 8, 2023
e6bcefb
#847 rename examples
Feb 13, 2023
ba92e0b
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
ea4248d
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
7671552
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
4d96c1f
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
b13ac24
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
fa2b38c
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
1dfafba
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
a6db54b
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
8dfabb9
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
1cd8202
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
1e4c332
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 13, 2023
b374ba9
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
f3616d0
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
4f23492
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
6e1102e
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
b9f9bb6
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
c82380e
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
bb293b9
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
05e7763
Update examples/adeo-kafka-request-reply.yml
GreenRover Feb 23, 2023
75feb78
fix mail adress to an exiting one
Feb 23, 2023
2d925ff
revert change open api version number
Feb 23, 2023
4cdfc75
add operations[x].reply.messages
Mar 1, 2023
02a75ff
#847 add second kraken-websocket example
Mar 8, 2023
9863f5e
Merge branch 'next-major-spec' into request-reply
GreenRover Mar 10, 2023
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
332 changes: 332 additions & 0 deletions examples/adeo-kafka-request-reply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,332 @@
asyncapi: 3.0.0
info:
title: Adeo AsyncAPI Case Study
version: "%REPLACED_BY_MAVEN%"
description: >
This Adeo specification illustrates how ADEO uses AsyncAPI to document some of their exchanges
contact:
name: AsyncAPI team
email: info@asyncapi.io
servers:
production:
url: "prod.url:9092"
protocol: kafka-secure
description: Kafka PRODUCTION cluster
security:
- sasl-ssl: []
bindings:
kafka:
schemaRegistryUrl: >-
https://schema-registry.prod.url/
staging:
url: "staging.url:9092"
protocol: kafka-secure
description: Kafka STAGING cluster for `uat` and `preprod` environments
security:
- sasl-ssl: []
bindings:
kafka:
schemaRegistryUrl: >-
https://schema-registry.staging.url/
dev:
url: "dev.url:9092"
protocol: kafka-secure
description: Kafka DEV cluster for `dev` and `sit` environments
security:
- sasl-ssl: []
bindings:
kafka:
schemaRegistryUrl: >-
https://schema-registry.dev.url/
tags:
- name: costing
description: "Costing channels, used by Costing clients."
channels:
costingRequest:
address: "adeo-{env}-case-study-COSTING-REQUEST-{version}"
description: >
Use this topic to do a Costing Request to Costing product.
We use the
[**RecordNameStrategy**](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#subject-name-strategy)
to infer the messages schema.
You have to define `x-value.subject.name.strategy` to
`io.confluent.kafka.serializers.subject.RecordNameStrategy` in your
producer to use the schema we manage.
The schema below illustrates how Costing Request messages are
handled.
![](https://user-images.githubusercontent.com/5501911/188920831-689cec5f-8dc3-460b-8794-0b54ec8b0ac8.png)
parameters:
env:
$ref: "#/components/parameters/Env"
version:
$ref: "#/components/parameters/Version"
bindings:
kafka:
replicas: 3
partitions: 3
topicConfiguration
cleanup.policy: delete
retention.ms: 7 days
messages:
costingRequest:
$ref: "#/components/messages/costingRequestV1"





costingResponse:
address: "adeo-{env}-case-study-COSTING-RESPONSE-{version}"
description: >
This topic is used to REPLY Costing Requests and is targeted by the
`REPLY_TOPIC` header.
**You must grant PUBLISH access to our `svc-ccr-app` service account.**.
We use the
[**RecordNameStrategy**](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#subject-name-strategy)
to infer the messages schema.
You have to define `key.subject.name.strategy` and
`x-value.subject.name.strategy` to
`io.confluent.kafka.serializers.subject.RecordNameStrategy` in your
consumer.
The schema below illustrates how Costing Response messages are
handled.
![](https://user-images.githubusercontent.com/5501911/188920831-689cec5f-8dc3-460b-8794-0b54ec8b0ac8.png)
parameters:
env:
$ref: "#/components/parameters/Env"
version:
$ref: "#/components/parameters/Version"
bindings:
kafka:
groupId:
type: string
description: >
The groupId must be prefixed by your `svc` account, deliver by the
Adeo Kafka team.
This `svc` must have the read access to the topic.
x-key.subject.name.strategy:
type: string
description: >
We use the RecordNameStrategy to infer the messages schema.
Use
`x-key.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
in your consumer configuration.
x-value.subject.name.strategy:
type: string
description: >
We use the RecordNameStrategy to infer the messages schema.
Use
`x-value.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
in your consumer configuration.
messages:
costingResponse:
$ref: "#/components/messages/costingResponse"





operations:
requestCosting:
action: receive
channel:
$ref: '#/channels/costingRequest'
reply:
channel:
$ref: '#/channels/costingResponse'
address:
locaton: '$message.header#/REPLY_TOPIC'
derberg marked this conversation as resolved.
Show resolved Hide resolved
summary: |
[COSTING] Request one or more Costing calculation for any product
description: >
You can try a costing request using our [Conduktor producer
template](https://conduktor.url)
tags:
- name: costing
bindings:
kafka:
groupId:
type: string
description: >
The groupId must be prefixed by your `svc` account, deliver by the
Adeo Kafka team.
This `svc` must have the write access to the topic.
x-value.subject.name.strategy:
type: string
description: >
We use the RecordNameStrategy to infer the messages schema.
Use
`x-value.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
in your producer configuration.
getCostingResponse:
action: send
channel:
$ref: '#/channels/costingResponse'
summary: >
[COSTING] Get the costing responses matching an initial Costing
Request.
tags:
- name: costing





components:
correlationIds:
costingCorrelationId:
description: >
This correlation ID is used for message tracing and messages
correlation.
This correlation ID is generated at runtime based on the `REQUEST_ID`
and sent to the RESPONSE message.
location: $message.header#/REQUEST_ID
messages:
costingRequestV1:
name: CostingRequestV1
title: Costing Request V1
summary: Costing Request V1 inputs.
tags:
- name: costing
schemaFormat: application/vnd.apache.avro;version=1.9.0
correlationId:
$ref: "#/components/correlationIds/costingCorrelationId"
headers:
type: object
required:
- REQUESTER_ID
- REQUESTER_CODE
- REQUEST_ID
- REPLY_TOPIC
properties:
REQUEST_ID:
$ref: "#/components/schemas/RequestId"
REPLY_TOPIC:
$ref: "#/components/schemas/ReplyTopic"
REQUESTER_ID:
$ref: "#/components/schemas/RequesterId"
REQUESTER_CODE:
$ref: "#/components/schemas/RequesterCode"
payload:
$ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingRequestPayload.avsc"
costingResponse:
name: CostingResponse
title: Costing Response
summary: Costing Response ouputs.
tags:
- name: costing
description: >
Please refer to the `CostingResponseKey.avsc` schema, available on [our
github
project](https://github.url/).
schemaFormat: application/vnd.apache.avro;version=1.9.0
correlationId:
$ref: "#/components/correlationIds/costingCorrelationId"
headers:
type: object
properties:
CALCULATION_ID:
$ref: "#/components/schemas/MessageId"
CORRELATION_ID:
$ref: "#/components/schemas/CorrelationId"
REQUEST_TIMESTAMP:
type: string
format: date-time
description: Timestamp of the costing request
CALCULATION_TIMESTAMP:
type: string
format: date-time
description: Technical timestamp for the costing calculation
bindings:
kafka:
key:
$ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponseKey.avsc"
payload:
$ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponsePayload.avsc"
schemas:
RequesterId:
type: string
description: The Costing requester service account used to produce costing request.
example: svc-ecollect-app
RequesterCode:
type: string
description: >-
The Costing requester code (generally the BU Code). The requester code
is useful to get the dedicated context (tenant).
example: 1
MessageId:
type: string
format: uuid
description: A unique Message ID.
example: 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
RequestId:
type: string
format: uuid
description: >-
A unique Request ID needed to define a `CORRELATION_ID` for exchanges,
which will be sent back in the Costing Responses.
example: 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
CorrelationId:
type: string
format: uuid
description: >-
A unique Correlation ID defined from the `REQUEST_ID` or the
`MESSAGE_ID` provided in the Costing Request.
example: 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
BuCode:
type: string
description: The Business Unit code for which data are applicable.
example: 1
ReplyTopic:
type: string
description: >
The Kafka topic where to send the Costing Response. This is required for
the [Return Address EIP
pattern](https://www.enterpriseintegrationpatterns.com/patterns/messaging/ReturnAddress.html).
**You must grant WRITE access to our `svc-ccr-app` service account.**
example: adeo-case-study-COSTING-RESPONSE-V1
ErrorStep:
type: string
description: |
The woker that has thrown the error.
example: EXPOSE_RESULT
ErrorMessage:
type: string
description: |
The error message describing the error.
example: Error message
ErrorCode:
type: string
description: |
The error code.
example: CURRENCY_NOT_FOUND
parameters:
Env:
description: Adeo Kafka Environement for messages publications.
schema:
type: string
enum:
- dev
- sit
- uat1
- preprod
- prod
Version:
description: the topic version you want to use
schema:
type: string
example: V1
default: V1
securitySchemes:
sasl-ssl:
type: plain
x-sasl.jaas.config: >-
org.apache.kafka.common.security.plain.PlainLoginModule required
username="<CLUSTER_API_KEY>" password="<CLUSTER_API_SECRET>";
x-security.protocol: SASL_SSL
x-ssl.endpoint.identification.algorithm: https
x-sasl.mechanism: PLAIN
description: >
Use [SASL authentication with SSL
encryption](https://docs.confluent.io/platform/current/security/security_tutorial.html#configure-clients)
to connect to the ADEO Broker.
Loading