forked from asyncapi/java-spring-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
application.yml
56 lines (56 loc) · 2.29 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
{%- 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 %}
host: tcp://{{server.url() | replace(':{port}', '')}}
port: {% if server.variable('port') %}{{server.variable('port').defaultValue()}}{% endif %}
username:
password:
topic:
{% for channelName, channel in asyncapi.channels() %}
{{channelName}}Topic: {{channelName}}
{% 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 %}