Skip to content
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

[Connections] Inline connections support #1331

Open
4 of 5 tasks
fcastill opened this issue Aug 21, 2020 · 0 comments
Open
4 of 5 tasks

[Connections] Inline connections support #1331

fcastill opened this issue Aug 21, 2020 · 0 comments
Assignees

Comments

@fcastill
Copy link
Collaborator

fcastill commented Aug 21, 2020

Is your feature request related to a problem? Please describe.

This is part of #1330 Connections support

This a feature request for supporting in-line connections

Example of inline connection in app.json

"activity" : {
  "ref": "#sql",
  "settings": {
    "connection": {
      "ref" : "github.com/project-flogo/contrib/connection/sql",
      "settings" : {
        "dbType": "mysql",
        "driver": "mysql",
        "dataSource": "username:password@tcp(host:port)/dbName",
      }
    }
  }
}

To Do

  • Import apps with connections
  • Export apps with connections
    • The refs of the used connections should be part of the imports of the app
  • Mapping of connections (Details below)
  • More?

Details of changes

For this iteration we don't have to validate that the attributes of the connection match with the declarations in the connection descriptor, so we don't need to add support for installing contributions of type connection. This will allow us to quickly provide basic support for connections.

We will mostly just update the mapper so if a contrib has a setting of type connection it won’t use the mapping wrapper. Also we will collect the connections refs to add them to the imports of the app during the export process.

Mapping of connections

Currently when the mapper UI infers that the user provided an value of type object it wraps the object with an attribute mapping. In order to support connections the mapper will need to first check if the attribute is of type connection and if it is then it should just store the object value provided by the user, for other types the old behavior should not be changed.

Examples:

❌ Wrong if setting foo has data type connection

"settings": {
    "foo": {
       "mapping": {
          "ref": "github.com/project-flogo/messaging-contrib/pulsar/connection",
          "settings": {
             "url": "pulsar://localhost:6650"
          }
        }
    }
},

✅ Correct if setting foo has data type connection

"settings": {
    "foo": {
        "ref": "github.com/project-flogo/messaging-contrib/pulsar/connection",
        "settings": {
           "url": "pulsar://localhost:6650"
        }
    }
},

Questions

  • Is the data type connection supported anywhere a data type can be used? If so:
    • Should it be allowed in the input/output of a resource? Or maybe its usage should be prevented.
    • Is the data type connection supported in the input of an activity/stage? If so:
      • How should it be handled in the inputs of the flow debugger?
      • How should it be displayed in the outputs of the flow debugger?
      • How should it be handled in the stream simulator?
  • Are aliases of connections refs allowed?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants