-
Notifications
You must be signed in to change notification settings - Fork 10
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
Enhancement: Generate channels values #313
Comments
Hi @bibiboss, i do not totally follow you, can you provide an example? Cheers |
Hello @jemacineiras Here a sub part of an asyncapi document asyncapi: 2.5.0
info:
title: Organization API MQTT interface contract
version: '1.0.0'
description: |
This document describe the input and output of the component "organization-api".
defaultContentType: application/json
channels:
events/public/output/{organizationId}:
description: The output topic
parameters:
organizationId:
$ref: '#/components/parameters/organizationId'
subscribe:
operationId: output
traits:
- bindings:
mqtt:
retain: true
message:
$ref: '#/components/messages/output'
# more definition (Full definition of this sample in issue #312 ) The channel I think it would be good to have in the generated code to have access to a representation of this channel. public enum InputChannel {
OUTPUT_CHANNEL("events/public/output/(.*)");
} In this example, I propose the following (that is up to discussion):
Is it clarifying? |
Hi @bibiboss , right, this type of channels are implemented only as producer using the StreamBridge. For generate the consumer we still need to work in the generation of this part. Mainly what we are build are beans for the Spring Cloud Function way of configuration. This feature is something we are considering since when you attach your consumer to a channel you need to know which one so variables are complicated to support. |
Hello @jemacineiras Indeed, they are related, but it is not exactly the same issue. The #292 is releated to cloud stream, kafka behaviors and pattern generation, but right now I'm working with MQTT. The channels will have different usage in my case, for instance figure out which callback to call on reception of a message based on the channel. |
In the asyncapi files, we have to declare the channels on which we want to exchange.
This value can be useful, for example in MQTT you might use this channel to have a pattern to which to subscribe to (same for kafka).
Same thing when you want to publish a message.
I don't know how the parameters could be handled tho'
Any thoughts?
The text was updated successfully, but these errors were encountered: