Skip to content

Commit

Permalink
feat(docs): add full examples for amqp tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushmantri authored and shrutimantri committed Sep 7, 2024
1 parent c3ac68f commit 977419f
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 43 deletions.
17 changes: 12 additions & 5 deletions src/main/java/io/kestra/plugin/amqp/Consume.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@
@Plugin(
examples = {
@Example(
code = {
"url: amqp://guest:guest@localhost:5672/my_vhost",
"queue: kestramqp.queue",
"maxRecords: 1000"
}
full = true,
code = """
id: amqp_consume
namespace: company.team
tasks:
- id: consume
type: io.kestra.plugin.amqp.Consume
url: amqp://guest:guest@localhost:5672/my_vhost
queue: kestramqp.queue
maxRecords: 1000
"""
)
}
)
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/io/kestra/plugin/amqp/CreateQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@
@Plugin(
examples = {
@Example(
code = {
"url: amqp://guest:guest@localhost:5672/my_vhost",
"name: kestramqp.queue"
}
full = true,
code = """
id: amqp_create_queue
namespace: company.team
tasks:
- id: create_queue
type: io.kestra.plugin.amqp.CreateQueue
url: amqp://guest:guest@localhost:5672/my_vhost
name: kestramqp.queue
"""
)
}
)
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/io/kestra/plugin/amqp/DeclareExchange.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@
@Plugin(
examples = {
@Example(
code = {
"url: amqp://guest:guest@localhost:5672/my_vhost",
"name: kestramqp.exchange"
}
full = true,
code = """
id: amqp_declare_exchange
namespace: company.team
tasks:
- id: declare_exchange
type: io.kestra.plugin.amqp.DeclareExchange
url: amqp://guest:guest@localhost:5672/my_vhost
name: kestramqp.exchange
"""
)
}
)
Expand Down
31 changes: 19 additions & 12 deletions src/main/java/io/kestra/plugin/amqp/Publish.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,25 @@
@Plugin(
examples = {
@Example(
code = {
"url: amqp://guest:guest@localhost:5672/my_vhost",
"exchange: kestramqp.exchange",
"from:",
"- data: value-1",
" headers:",
" testHeader: KestraTest",
" timestamp: '2023-01-09T08:46:33.103130753Z'",
"- data: value-2",
" timestamp: '2023-01-09T08:46:33.115456977Z'",
" appId: unit-kestra"
}
full = true,
code = """
id: amqp_publish
namespace: company.team
tasks:
- id: publish
type: io.kestra.plugin.amqp.Publish
url: amqp://guest:guest@localhost:5672/my_vhost
exchange: kestramqp.exchange
from:
- data: value-1
headers:
testHeader: KestraTest
timestamp: '2023-01-09T08:46:33.103130753Z'
- data: value-2
timestamp: '2023-01-09T08:46:33.115456977Z'
appId: unit-kestra
"""
)
}
)
Expand Down
17 changes: 12 additions & 5 deletions src/main/java/io/kestra/plugin/amqp/QueueBind.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@
@Plugin(
examples = {
@Example(
code = {
"url: amqp://guest:guest@localhost:5672/my_vhost",
"exchange: kestramqp.exchange",
"queue: kestramqp.queue"
}
full = true,
code = """
id: amqp_queue_bind
namespace: company.team
tasks:
- id: queue_bind
type: io.kestra.plugin.amqp.QueueBind
url: amqp://guest:guest@localhost:5672/my_vhost
exchange: kestramqp.exchange
queue: kestramqp.queue
"""
)
}
)
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/io/kestra/plugin/amqp/RealtimeTrigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@
namespace: company.team
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "{{ trigger.data }}"
- id: log
type: io.kestra.plugin.core.log.Log
message: "{{ trigger.data }}"
triggers:
- id: realtime_trigger
type: io.kestra.plugin.amqp.RealtimeTrigger
url: amqp://guest:guest@localhost:5672/my_vhost
queue: amqpTrigger.queue
"""
- id: realtime_trigger
type: io.kestra.plugin.amqp.RealtimeTrigger
url: amqp://guest:guest@localhost:5672/my_vhost
queue: amqpTrigger.queue
"""
)
}
)
Expand Down
17 changes: 12 additions & 5 deletions src/main/java/io/kestra/plugin/amqp/Trigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@
@Plugin(
examples = {
@Example(
code = {
"url: amqp://guest:guest@localhost:5672/my_vhost",
"maxRecords: 2",
"queue: amqpTrigger.queue"
}
full = true,
code = """
id: amqp_trigger
namespace: company.team
tasks:
- id: trigger
type: io.kestra.plugin.amqp.Trigger
url: amqp://guest:guest@localhost:5672/my_vhost
maxRecords: 2
queue: amqpTrigger.queue
"""
)
}
)
Expand Down

0 comments on commit 977419f

Please sign in to comment.