Complete Example: End-to-End Destination Setup

About this task

Scenario: Create Journey Destination for Production

Procedure

  1. Validate Prerequisites
cd $HCL_UNICA_DETECT_HOME/tools/bin

# Check Kafka cluster exists
./CliTool.sh get-all-kafka-cluster-names
# Output: [prod-kafka-cluster]

# Check datasource exists
./CliTool.sh get-all-datasource-names-for-logged-in-user
# Output: [UnicaDetectDS, PROD_DATASOURCE]

# Check templates available
./CliTool.sh get-all-message-templates
# Output: Template ID: 1, Name: Journey, Type: JOURNEY
  1. Create JSON Payload

Create file: prod-journey-destination.json

{
  "name": "Production Customer Journey Events",
  "description": "Publishes triggered journey events to production Journey instance via Kafka",
  "templateId": 1,
  "messageConfig": {
    "payloadEntrySourceCode": "PROD-ES-001"
  },
  "feedAttributeMapping": [
    {
      "feedId": "1",
      "attributes": {
        "profile": {
          "customerId": "CUSTOMER_ID",
          "customerName": "FULL_NAME",
          "email": "EMAIL",
          "segment": "CUSTOMER_SEGMENT"
        },
        "tuple": {
          "eventId": "EVENT_ID",
          "eventTimestamp": "TIMESTAMP",
          "eventType": "EVENT_TYPE",
          "eventChannel": "CHANNEL"
        }
      }
    }
  ],
  "connectorConfig": {
    "kafka": {
      "connectorType": "KAFKA",
      "topic": "prod-journey-events",
      "clusterName": "prod-kafka-cluster"
    },
    "mariaDb": {
      "connectorType": "MARIADB",
      "datasourceName": "PROD_DATASOURCE",
      "databaseName": "journey_audit_db"
    }
  }
}
  1. Validate JSON
# Check JSON syntax
jq . < prod-journey-destination.json

# Output: (formatted JSON if valid)
  1. Create Destination
./CliTool.sh create-destination -f prod-journey-destination.json

# Output:
# Destination created successfully with ID: 100
  1. Verify Creation
./CliTool.sh get-destination-by-id -id 100

# Verify output shows correct configuration
  1. Document Destination ID
    echo "Production Journey Destination ID: 100" >> deployment-notes.txt