{
  "id": "event-4",
  "title": "Outbound Events: How do I stream events to Azure Service Bus?",
  "description": "Configure event streaming to Azure Service Bus for enterprise messaging patterns. Enable reliable message delivery with queues and topics for decoupled, scalable architectures.",
  "category": "Outbound Events",
  "tags": [
    "Outbound Events",
    "Azure Service Bus",
    "Azure",
    "Enterprise Messaging",
    "Message Queue"
  ],
  "api": "Outbound Events",
  "language": "Json",
  "lastUpdated": "2026-03-20",
  "openApiEndpoints": [
    "/configs/v1/event-sinks"
  ],
  "relatedGuides": [
    "/guides/guide-outbound-events",
    "/guides/guide-sandbox"
  ],
  "commonErrors": [
    {
      "code": "401",
      "message": "UNAUTHENTICATED",
      "solution": "Verify ServiceAccount credentials are valid"
    },
    {
      "code": "400",
      "message": "INVALID_ARGUMENT",
      "solution": "Check event sink configuration format and destination URL"
    }
  ],
  "summary": "This example streams graph events to Azure Service Bus:\n\nAzure Service Bus benefits:\n- Enterprise-grade messaging with guaranteed delivery\n- Topics with multiple subscriptions (fan-out pattern)\n- Dead-letter queues for failed messages\n- Message sessions and ordering\n- Integration with Azure services\n\nDifference from Event Grid:\n- Service Bus: Reliable message queuing, enterprise patterns\n- Event Grid: Lightweight event routing, serverless triggers",
  "usecase": "Scenario: Send inventory updates to multiple downstream systems reliably.\n\nService Bus architecture:\nIndyKite -> Event Sink -> Service Bus Topic\n                              ├-> Subscription 1 (Inventory System)\n                              ├-> Subscription 2 (Analytics)\n                              └-> Subscription 3 (Audit Log)\n\nEvent configuration:\n- Event type: indykite.audit.capture.* (all CRUD operations)\n- Filter: Car nodes where manufacturer=\"pontiac\"\n\nBenefits:\n- Each subscription processes events independently\n- Failed processing goes to dead-letter queue\n- Guaranteed at-least-once delivery",
  "requirements": "Prerequisites:\n- ServiceAccount credentials: For configuration (Bearer token)\n- AppAgent credentials: For data ingestion (X-IK-ClientKey)\n- Azure Service Bus namespace with:\n  - Topic created\n  - Topic subscription configured\n  - Connection string available",
  "steps": "Step 1: Set Up Azure Service Bus\n- Action: Create Service Bus namespace, topic, and subscription\n- Note: Connection string needed for authentication\n\nStep 2: Create Event Sink Configuration\n- Authentication: ServiceAccount credential (Bearer token)\n- Action: POST Event Sink with:\n  - Provider: Azure Service Bus\n  - Event type: indykite.audit.capture.*\n  - Filters: Car label, manufacturer=\"pontiac\"\n  - Connection: Service Bus namespace and topic\n- Result: Event Sink active\n\nStep 3: Ingest Matching Nodes\n- Authentication: AppAgent credential (X-IK-ClientKey)\n- Action: POST Car nodes with manufacturer=\"pontiac\"\n- Result: Messages delivered to Service Bus topic\n\nStep 4-6: Verify Message Delivery\n- Add and delete matching nodes\n- Check Service Bus for received messages\n- Verify non-matching operations don't generate messages",
  "code": [
    {
      "step": "Step 2",
      "description": "Create an EventSink configuration. ",
      "filename": "POST https://eu.api.indykite.com/configs/v1/event-sinks",
      "language": "Json",
      "ingest": {
        "project_id": "your_project_gid",
        "description": "description of eventsink",
        "display_name": "eventsink name",
        "name": "eventsink-name",
        "include_cdc_events": false,
        "providers": {
          "provider-with-azure-service-bus": {
            "azure_service_bus": {
              "queue_or_topic_name": "test-queue",
              "connection_string": "Endpoint=sb://your-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=a...."
            }
          }
        },
        "routes": [
          {
            "provider_id": "provider-with-azure-service-bus",
            "event_type_key_values_filter": {
              "context_key_value": [
                {
                  "key": "manufacturer",
                  "value": "pontiac"
                },
                {
                  "key": "captureLabel",
                  "value": "Car"
                }
              ],
              "event_type": "indykite.audit.capture.upsert.node"
            },
            "stop_processing": true,
            "display_name": "Configuration Audit Events"
          }
        ]
      }
    },
    {
      "step": "Step 3",
      "description": "Capture the nodes needed for this use case.",
      "filename": "POST https://eu.api.indykite.com/capture/v1/nodes/",
      "ingest": {
        "nodes": [
          {
            "external_id": "alice",
            "is_identity": true,
            "type": "Person",
            "properties": [
              {
                "type": "email",
                "value": "alice@email.com"
              },
              {
                "type": "given_name",
                "value": "Alice"
              },
              {
                "type": "last_name",
                "value": "Smith"
              }
            ]
          },
          {
            "external_id": "knightrider",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "knightrider@demo.com"
              },
              {
                "type": "name",
                "value": "Michael Knight"
              }
            ]
          },
          {
            "external_id": "satchmo",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "satchmo@demo.com"
              },
              {
                "type": "name",
                "value": "Louis Armstrong"
              }
            ]
          },
          {
            "external_id": "karel",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "karel@demo.com"
              },
              {
                "type": "name",
                "value": "Karel Plihal"
              }
            ]
          },
          {
            "external_id": "kitt",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Firebird"
              }
            ]
          },
          {
            "external_id": "cadillacv16",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Cadillac"
              },
              {
                "type": "model",
                "value": "V-16"
              }
            ]
          },
          {
            "external_id": "harmonika",
            "type": "Bus",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Ikarus"
              },
              {
                "type": "model",
                "value": "280"
              }
            ]
          },
          {
            "external_id": "listek",
            "type": "Ticket",
            "is_identity": false
          },
          {
            "external_id": "airbook-xyz",
            "type": "Laptop",
            "is_identity": false
          }
        ]
      }
    },
    {
      "step": "Step 4",
      "description": "Capture the nodes needed for this use case.",
      "filename": "POST https://eu.api.indykite.com/capture/v1/nodes/",
      "ingest": {
        "nodes": [
          {
            "external_id": "kitten",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Bonneville"
              }
            ]
          },
          {
            "external_id": "kitty",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Catalina"
              }
            ]
          }
        ]
      }
    }
  ],
  "links": {
    "html": "/resources/event-4",
    "markdown": "/resources/event-4.md",
    "openApi": "https://openapi.indykite.com/"
  }
}