Skip to main content
This page covers how to develop, build, and test your custom connectors using the iPaaS platform.

Overview

Custom connectors are built using:
  • Apache Camel-K: Integration framework for Kubernetes
  • Maven: Build and dependency management
  • Java: Primary development language
  • GitHub Actions: Continuous integration and deployment

Development workflow

Follow this workflow to develop your connector locally and prepare it for deployment.

Local development setup

Prerequisites

Install the following tools on your local machine:

Clone your repository

git clone <your-organization>/my-custom-connector.git
cd my-custom-connector
git checkout develop

Understand the project structure

Your connector template includes:
src/
├── main/
│   ├── java/
│   │   └── com/backbase/gc/connector/
│   │       └── MyConnectorApplication.java
│   └── resources/
│       ├── application.properties
│       └── routes/
│           └── integration-route.xml
├── test/
│   └── java/
│       └── ... (test files)
└── pom.xml
Key files:
  • pom.xml: Maven project configuration and dependencies
  • application.properties: Configuration properties for your connector
  • routes/: Camel route definitions (XML or Java DSL)
  • MyConnectorApplication.java: Main application class

Build your connector

Use Maven to compile, test, and package your connector.

Build locally

# Clean and compile
mvn clean compile

# Run tests
mvn test

# Package the connector
mvn package

# Skip tests (for faster builds during development)
mvn package -DskipTests

Build output

The build process creates:
  • JAR file: target/my-custom-connector-<version>.jar
  • Test reports: target/surefire-reports/
  • Docker image (if configured): For Camel-K deployment

Develop integration routes

Define your integration logic using Apache Camel routes.

Camel route basics

Connectors use Apache Camel routes to define integration flows. Routes can be defined in: XML DSL (recommended for complex routes):
<routes xmlns="http://camel.apache.org/schema/spring">
  <route id="my-integration-route">
    <from uri="timer:trigger?period=5000"/>
    <log message="Processing integration"/>
    <to uri="http://external-api.com/endpoint"/>
  </route>
</routes>
Java DSL (for programmatic routes):
from("timer:trigger?period=5000")
  .log("Processing integration")
  .to("http://external-api.com/endpoint");

Common integration patterns

REST API integration:
<route id="rest-api-route">
  <from uri="rest:get:/api/data"/>
  <to uri="http://external-service.com/api/data"/>
  <convertBodyTo type="java.lang.String"/>
</route>
Message transformation:
<route id="transform-route">
  <from uri="direct:input"/>
  <transform>
    <simple>${body.toUpperCase()}</simple>
  </transform>
  <to uri="direct:output"/>
</route>
Error handling:
<route id="error-handling-route">
  <from uri="direct:start"/>
  <doTry>
    <to uri="http://external-api.com"/>
    <doCatch>
      <exception>java.lang.Exception</exception>
      <log message="Error occurred: ${exception.message}"/>
      <to uri="direct:error-handler"/>
    </doCatch>
  </doTry>
</route>

Configure your connector

Configure your connector using properties files and environment variables.

Application properties

Configure your connector in src/main/resources/application.properties:
# External API Configuration
external.api.url=https://api.example.com
external.api.timeout=5000

# Authentication
external.api.key=${EXTERNAL_API_KEY}

# Connection Settings
connection.pool.size=10
connection.retry.attempts=3

Environment variables

Use environment variables for sensitive data:
  • Secrets are managed through the self-service repository
  • Access via ${VARIABLE_NAME} in properties files
  • Set in Kubernetes deployment configurations

Test your connector

Write and run tests to verify your connector works correctly.

Unit tests

Write unit tests for your routes and components:
@Test
public void testIntegrationRoute() {
    MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
    mockEndpoint.expectedMessageCount(1);
    
    template.sendBody("direct:start", "test data");
    
    mockEndpoint.assertIsSatisfied();
}

Integration tests

Test against real or mocked external services:
@SpringBootTest
public class ConnectorIntegrationTest {
    @Autowired
    private CamelContext camelContext;
    
    @Test
    public void testEndToEndFlow() {
        // Test complete integration flow
    }
}

Run tests

# Run all tests
mvn test

# Run specific test class
mvn test -Dtest=MyConnectorTest

# Run with coverage
mvn test jacoco:report

Validate code quality

Ensure your code meets quality standards before committing.

Automated checks

The CI/CD pipeline automatically runs:
  • Maven Build Validation: Ensures project compiles
  • SonarCloud Analysis: Code quality and security scanning
  • Test Execution: All unit and integration tests

Pre-commit checklist

Before committing your code:
  • Code compiles without errors
  • All tests pass locally
  • No hardcoded credentials or secrets
  • Configuration uses environment variables
  • Code follows project conventions
  • Documentation is updated

Manage version control

Use Git for version control and follow the branching strategy.

Branch strategy

  • develop: Main development branch
  • main: Production-ready code
  • Feature branches: feature/my-feature
  • Release branches: release/v1.0.0

Commit best practices

Follow conventional commits with Jira scope:
feat(GC-123): Add payment processing endpoint
fix(GC-124): Resolve authentication timeout issue
chore(GC-125): Update dependencies

Pull request process

  1. Create a feature branch from develop
  2. Make your changes and commit
  3. Push to GitHub and create a Pull Request
  4. Wait for CI checks to pass
  5. Get code review approval
  6. Merge to develop when approved

Manage dependencies

Manage your project’s dependencies in the Maven pom.xml file.

Add dependencies

Edit pom.xml to add dependencies:
<dependencies>
  <dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-http</artifactId>
    <version>${camel.version}</version>
  </dependency>
  <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
  </dependency>
</dependencies>

Common dependencies

  • Camel components: HTTP, REST, JMS, Kafka, and others
  • JSON Processing: Jackson, Gson
  • Logging: SLF4J, Logback
  • Testing: JUnit, Mockito, Camel Test

Find dependencies

Build for production

Prepare your connector for production deployment.

Release process

  1. Update version in pom.xml
  2. Create release branch from develop
  3. Run full test suite
  4. Merge to main after approval
  5. Tag the release in GitHub

Build artifacts

The build process creates:
  • JAR artifact: For deployment
  • Docker image (if configured): For containerized deployment
  • Documentation: Generated API docs

CI/CD pipeline

Your connector repository includes GitHub Actions workflows that automatically:
  • Validate Pull Requests: Run Maven build and tests
  • Code Quality: SonarCloud analysis
  • Security Scanning: Dependency vulnerability checks
  • Build Artifacts: Create JAR files and Docker images
Pipeline status: Common pipeline checks:
  • Validate pull request / Verify Maven project - Ensures code compiles
  • SonarCloud Code Analysis - Code quality and security checks

Quick reference: common commands

Use these commands for common development tasks.

Git commands

# Clone repository
git clone <repo-url>
git checkout develop

# Create feature branch
git checkout -b feature/my-feature

# Commit and push
git add .
git commit -m "feat(GC-123): Description"
git push origin feature/my-feature

Maven commands

# Clean and build
mvn clean install

# Run tests
mvn test

# Skip tests
mvn package -DskipTests

# Check dependencies
mvn dependency:tree

# Update dependencies
mvn versions:display-dependency-updates

Kubernetes commands

If you have access to the Kubernetes cluster, you can use these commands:
# List pods
kubectl get pods -n <namespace>

# View logs
kubectl logs -f <pod-name> -n <namespace>

# Describe deployment
kubectl describe deployment <deployment-name> -n <namespace>

# Get services
kubectl get svc -n <namespace>

Troubleshooting

Resolve common issues that occur during development.

Build failures

Issue: Maven build fails
  • Solution: Check Java version compatibility
  • Solution: Verify all dependencies are available
  • Solution: Clean and rebuild: mvn clean install
  • Resources: Maven Troubleshooting Guide
Issue: Tests fail locally but pass in CI
  • Solution: Ensure environment variables are set
  • Solution: Check for local configuration differences
  • Solution: Review test output in target/surefire-reports/

Dependency issues

Issue: Missing dependencies
  • Solution: Check Maven repository access
  • Solution: Verify dependency versions in pom.xml
  • Solution: Check Maven Central for correct coordinates
Issue: Version conflicts
  • Solution: Use mvn dependency:tree to identify conflicts
  • Solution: Use mvn versions:display-dependency-updates to check for updates

Common issues

Issue: Camel route not working
  • Solution: Check Apache Camel Error Handling
  • Solution: Verify route configuration and component availability
  • Solution: Enable debug logging to trace route execution
Issue: Access denied errors
  • Solution: Verify roles in self-service.tfvars
  • Solution: Contact team lead for access requests
  • Solution: Check GitHub team membership

Best practices

  1. Keep routes simple: Break complex flows into smaller routes
  2. Use configuration: Avoid hardcoding values
  3. Handle errors: Implement proper error handling and retries
  4. Log appropriately: Use appropriate log levels
  5. Test thoroughly: Write unit and integration tests
  6. Document changes: Update README and inline documentation
  7. Follow naming conventions: Use consistent naming for routes and components
  8. Review dependencies: Regularly update dependencies for security patches

Next steps

  • Run: Deploy and run your connector
  • Monitor: Monitor connector health and performance