-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
application.yml
70 lines (70 loc) · 3.33 KB
/
application.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{%- set hasSubscribe = false -%}
{%- set hasPublish = false -%}
{%- for channelName, channel in asyncapi.channels() -%}
{%- if channel.hasPublish() -%}
{%- set hasPublish = true -%}
{%- endif -%}
{%- if channel.hasSubscribe() -%}
{%- set hasSubscribe = true -%}
{%- endif -%}
{%- endfor -%}
{%- for serverName, server in asyncapi.servers() %}{% if server.protocol() == 'amqp' %}
amqp:
broker: {% for line in server.description() | splitByLines %}
# {{line | safe}}{% endfor %}
host: {{server.url() | replace(':{port}', '') }}
port: {% if server.variable('port') %}{{server.variable('port').defaultValue()}}{% endif %}
username:
password:
exchange:
{% for channelName, channel in asyncapi.channels() %}
{% if channel.hasSubscribe() and channel.subscribe().binding('amqp') %}
{{channelName}}: {{channel.subscribe().binding('amqp').exchange.name}}
{% endif %}
{% endfor %}
queue:
{% for channelName, channel in asyncapi.channels() %}
{% if channel.hasPublish() and channel.publish().binding('amqp') %}
{{channelName}}: {{channel.publish().binding('amqp').queue.name}}
{% endif %}
{% endfor %}
{% endif %}
{% if server.protocol() == 'mqtt' %}
mqtt:
broker: {% for line in server.description() | splitByLines %}
# {{line | safe}}{% endfor %}
address: {% if server.variable('port') %}{{server.url() | replace('{port}', server.variable('port').defaultValue())}}{% else %}{{server.url()}}{% endif %}
username:
password:
{% if server.binding('mqtt') and server.binding('mqtt').clientId %}clientId: {{server.binding('mqtt').clientId}}{% endif %}
{% if server.binding('mqtt') and server.binding('mqtt').cleanSession | isDefined %}cleanSession: {{server.binding('mqtt').cleanSession}}{% endif %}
{% if server.binding('mqtt') and server.binding('mqtt').lastWill %}lastWill:
topic: {{server.binding('mqtt').lastWill.topic}}
message: {{server.binding('mqtt').lastWill.message}}
qos: {{server.binding('mqtt').lastWill.qos}}
retain: {{server.binding('mqtt').lastWill.retain}}
{% endif %}
timeout:
completion: {{params.completionTimeout}}
disconnection: {{params.disconnectionTimeout}}
connection: {{params.connectionTimeout}}
{% if server.binding('mqtt') and server.binding('mqtt').keepAlive | isDefined %}keepAlive: {{server.binding('mqtt').keepAlive}}{% endif %}
topic:
{% for channelName, channel in asyncapi.channels() %}{% if channel.hasPublish() %}
{{channel.publish().id() | camelCase}}: {{channelName}}
{% elif channel.hasSubscribe() %}
{{channel.subscribe().id() | camelCase}}: {{channelName}}
{% endif %}{% endfor %}
{% endif %}{% endfor %}
{%- if asyncapi | isProtocol('kafka') %}
spring:
kafka: {% for serverName, server in asyncapi.servers() %}
# - {{serverName}} in {{server.url()}} : {% for line in server.description() | splitByLines %}
# {{line | safe}}{% endfor %}{% endfor %}
bootstrap-servers: {% for serverName, server in asyncapi.servers() %}{% if server.variable('port') %}{{server.url() | replace('{port}', server.variable('port').defaultValue())}}{% else %}{{server.url()}}{% endif %}{% if not loop.last %},{% endif %}{% endfor %}
{%- if hasPublish %}
listener:
poll-timeout: {{params.listenerPollTimeout}}
concurrency: {{params.listenerConcurrency}}
{% endif %}
{% endif %}