Skip to content

Commit

Permalink
Merge pull request #258 from asyncapi/feature/protocol-info-as-bindings
Browse files Browse the repository at this point in the history
Rename protocolInfo as bindings and restrict common protocols
  • Loading branch information
fmvilas authored Aug 26, 2019
2 parents a0f8ac3 + fbf6799 commit d75d0d5
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 110 deletions.
20 changes: 15 additions & 5 deletions examples/next/gitter-streaming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ channels:
- chatMessages
- events
subscribe:
protocolInfo:
bindings:
http:
response:
headers:
'Transfer-Encoding': 'chunked'
Trailer: '\r\n'
type: response
message:
oneOf:
- $ref: '#/components/messages/chatMessage'
Expand Down Expand Up @@ -145,10 +142,23 @@ components:
gv:
type: string
description: Stands for "Gravatar version" and is used for cache busting.
bindings:
http:
$ref: '#/components/messageBindings/streamingHeaders'

heartbeat:
schemaFormat: 'application/schema+yaml;version=draft-07'
summary: Its purpose is to keep the connection alive.
payload:
type: string
enum: ["\r\n"]
bindings:
http:
$ref: '#/components/messageBindings/streamingHeaders'

messageBindings:
streamingHeaders:
http:
headers:
'Transfer-Encoding': 'chunked'
Trailer: '\r\n'
32 changes: 15 additions & 17 deletions examples/next/rpc-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ channels:
schema:
type: string
pattern: '^amq\\.gen\\-.+$'
protocolInfo:
amqp-0-9-1:
channelIsQueue: true
bindings:
amqp:
is: queue
queue:
randomName: true
exclusive: true
subscribe:
operationId: receiveSumResult
protocolInfo:
amqp-0-9-1:
noAck: true
bindings:
amqp:
ack: false
message:
correlationId:
location: $message.header#/correlation_id
Expand All @@ -42,22 +41,21 @@ channels:
- 7

rpc_queue:
protocolInfo:
amqp-0-9-1:
channelIsQueue: true
bindings:
amqp:
is: queue
queue:
durable: false
publish:
operationId: requestSum
protocolInfo:
amqp-0-9-1:
bindings:
amqp:
ack: true
message:
protocolInfo:
amqp-0-9-1:
properties:
reply_to:
type: string
bindings:
amqp:
replyTo:
type: string
correlationId:
location: $message.header#/correlation_id
payload:
Expand Down
26 changes: 12 additions & 14 deletions examples/next/rpc-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ channels:
schema:
type: string
pattern: '^amq\\.gen\\-.+$'
protocolInfo:
amqp-0-9-1:
channelIsQueue: true
bindings:
amqp:
is: queue
queue:
randomName: true
exclusive: true
publish:
operationId: sendSumResult
protocolInfo:
amqp-0-9-1:
bindings:
amqp:
ack: true
message:
correlationId:
Expand All @@ -42,19 +41,18 @@ channels:
- 7

rpc_queue:
protocolInfo:
amqp-0-9-1:
channelIsQueue: true
bindings:
amqp:
is: queue
queue:
durable: false
subscribe:
operationId: sum
message:
protocolInfo:
amqp-0-9-1:
properties:
reply_to:
type: string
bindings:
amqp:
replyTo:
type: string
correlationId:
location: $message.header#/correlation_id
payload:
Expand Down
4 changes: 2 additions & 2 deletions examples/next/streetlights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,6 @@ components:

operationTraits:
kafka:
protocolInfo:
bindings:
kafka:
applicationId: my-app-id
clientId: my-app-id
Loading

0 comments on commit d75d0d5

Please sign in to comment.