Prerequisites
Before you start, make sure you have:- A connector repository scaffolded from the connector template. For more information, see Set up the project.
- Sync Hub deployed in your target runtime, with a topic for your events. For more information, see Sync Hub deployment and configuration.
- Java and Maven installed for local builds.
Build the connector
The template includes an event publish route that posts to the Sync Hub producer through thegc-http-caller Kamelet. You configure the route with properties instead of writing HTTP calls by hand.
-
Define the event contract. Decide the topic name, the event source domain, the schema version, and the payload shape inside the
dataobject. Align these with the teams that consume the event. -
Set the Sync Hub properties in the connector’s
application.propertiesfile:The template route builds the publish endpoint as${asb.producer.apiUri}/${asb.event.topic}/publishand sets thebbEventTypeheader fromasb.event.type. The template hardcodes theeventSourceheader and deriveseventVersionfrom the payload schema. In a production connector, set these headers from your own configuration, for example with theasb.event.sourceandasb.event.versionproperties. Theasb.event.typevalue shown is an example. Use the event spec class that matches your event contract. Confirm the producer release name in the Application manifest for your runtime. Some runtimes deploy a versioned release name such asasb-producer-v0. For property descriptions, see Connector properties. -
Implement the route logic: read from the source system, transform the payload into your event contract, and set the per-request values
identifierandtraceParenton the outgoing message. These values change for each event, so the connector sets them per request rather than in configuration. For route structure guidance, see Anatomy of a connector. -
Add the Sync Hub pod labels to the connector’s
values.yamlfile so the runtime network policy allows the call to the producer: -
Build and run the connector locally:
Verify the connector
To confirm the connector publishes events:- Trigger the route in your local or development environment.
- Check the connector logs for a successful publish to the producer.
- Check the producer logs in Grafana for the matching publish activity. For queries, see Logs.
- Confirm the message arrives on the topic with Azure Service Bus tooling. For more information, see Service Bus explorer.
Next steps
- Configure a custom connector: Secrets, properties, and traits for deployment.
- Test and validate: Add automated tests for your route.
- Sync Hub go-live checklist: Verify your setup before production.