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

Revamp Connectors for Update 4.4.0 #4058

Open
RDPerera opened this issue Feb 28, 2025 · 1 comment
Open

Revamp Connectors for Update 4.4.0 #4058

RDPerera opened this issue Feb 28, 2025 · 1 comment
Assignees

Comments

@RDPerera
Copy link

RDPerera commented Feb 28, 2025

Description:

All connectors need to be updated to align with WSO2 MI 4.4.0 enhancements, including a new response model, test connection functionality, and structured output schemas for improved usability and reliability.

Tasks:

1. Implement New Response Model

  • Modify the connector to store responses in a structured variable instead of overwriting the message context.
  • Ensure the response contains:
    • Payload: The main response data.
    • Headers: HTTP headers associated with the response.
    • Attributes: Metadata such as status codes.
  • Maintain backward compatibility by providing an option to override the message body in the message context.

2. Add Output Schemas for Operations

  • Each connector operation should have a corresponding output-schema file under <Connector-Home>/src/main/resources/outputschema.
  • Output schemas should define the expected response structure using JSON Schema.
  • Example output-schema file for read.json operation:
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "title": "Output Schema for read Operation",
    "description": "Defines the output structure of the read operation.",
    "properties": {
        "payload": { "type": "object" },
        "attributes": {
            "type": "object",
            "properties": {
                "FILE_LAST_MODIFIED_TIME": { "type": "string", "format": "date-time" },
                "FILE_IS_DIR": { "type": "boolean" },
                "FILE_PATH": { "type": "string" },
                "FILE_NAME": { "type": "string" },
                "FILE_SIZE": { "type": "integer", "minimum": 0 }
            },
            "additionalProperties": false
        }
    },
    "required": ["payload", "attributes"],
    "additionalProperties": false
}

3. Implement Connection Test Feature

  • Introduce a new testconnection.xml operation for validating connection parameters.
  • Ensure this operation:
    • Runs a lightweight test to check if the connection parameters are valid.
    • Returns appropriate error messages if the connection fails.
    • Remains hidden from the operation palette.
  • Update the UI schema to include "testConnectionEnabled": true to enable the feature in the VSCode Extension.

4. Improve Dependency Management

  • Introduce a descriptor file to manage dependencies required by the connector.
  • Ensure dependencies are automatically added to pom.xml when the connector is imported.
  • Pack necessary JAR files inside the CAR file for runtime execution.
  • Example descriptor file:
dependencies:
  - groupId: "org.apache.kafka"
    artifactId: "kafka-clients"
    version: "3.7.0"
repositories:
  - id: "wso2-nexus"
    url: "https://maven.wso2.org/nexus/content/groups/wso2-public/"

Version

MI 4.4.0

@RDPerera
Copy link
Author

RDPerera commented Feb 28, 2025

Under the connection revamp effort, the following priority will be applied and assigned as follows:

  1. File Connector – Assignee: @arunans23
  2. Email Connector – Assignee: @RDPerera

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