Skip to content

Streaming (Dr. Strange)

Status: Active | Port: 6650, 8082 | Profile: think, reason, ultra-instinct

The arc-streaming service (Dr. Strange) is the platform event streaming service built on Apache Pulsar. It provides durable, ordered, multi-consumer topic streams — the persistent event layer of the A.R.C. messaging system. Events can be replayed from any point in time.

For low-latency ephemeral messaging, see Messaging (Flash).

Quick Reference

FieldValue
Imageghcr.io/arc-framework/arc-streaming:latest
Port(s)6650 (broker), 8082 (admin HTTP)
Healthhttp://localhost:8082/admin/v2/brokers/health
Metricshttp://localhost:8082/metrics
Profile(s)think, reason, ultra-instinct (core)

Make Targets

TargetDescription
make streaming-upStart the service
make streaming-downStop the service
make streaming-healthCheck health
make streaming-logsTail service logs

When to Use Streaming (Dr. Strange)

Streaming (Dr. Strange) handles durable, replayable event streams:

Use CaseStreaming (Dr. Strange)Messaging (Flash)
Event sourcing / CQRS
Audit logs and compliance
Replay historical events
Cross-service event distribution
Data pipelines / ETL
Low-latency agent RPC
Request/reply patterns

Topic Hierarchy

Tenant (arc)
  └── Namespace (agents)
      └── Topic (inference.completed)
          └── Partitions (0, 1, 2, ...)

Platform Events

The Reasoner (Sherlock) publishes these Pulsar topics:

TopicDescription
arc.request.receivedInference request accepted
arc.inference.completedInference finished with token usage
arc.billing.usageAggregated usage for billing

Admin CLI

bash
# Access Pulsar admin CLI inside container
docker compose exec arc-streaming bin/pulsar-admin

# List namespaces
docker compose exec arc-streaming bin/pulsar-admin namespaces list arc

# Create namespace
docker compose exec arc-streaming bin/pulsar-admin namespaces create arc/agents

# List topics
docker compose exec arc-streaming bin/pulsar-admin topics list arc/agents

# Check topic backlog
docker compose exec arc-streaming bin/pulsar-admin topics stats arc/agents/inference.completed

Client Libraries

LanguagePackage
Gogithub.com/apache/pulsar-client-go/pulsar
Pythonpulsar-client
Javapulsar-client

Go Example

go
import "github.com/apache/pulsar-client-go/pulsar"

client, _ := pulsar.NewClient(pulsar.ClientOptions{
    URL: "pulsar://localhost:6650",
})
defer client.Close()

// Producer
producer, _ := client.CreateProducer(pulsar.ProducerOptions{
    Topic: "arc/agents/inference.completed",
})
producer.Send(context.Background(), &pulsar.ProducerMessage{
    Payload: []byte(`{"request_id":"abc","tokens":512}`),
})

// Consumer with replay from earliest
consumer, _ := client.Subscribe(pulsar.ConsumerOptions{
    Topic:            "arc/agents/inference.completed",
    SubscriptionName: "billing-service",
    SubscriptionInitialPosition: pulsar.SubscriptionPositionEarliest,
})
msg, _ := consumer.Receive(context.Background())
consumer.Ack(msg)

Message Replay

bash
# Replay from earliest message on a subscription
docker compose exec arc-streaming bin/pulsar-client consume \
  --subscription-position Earliest arc/agents/inference.completed

# Seek to specific timestamp (ISO 8601)
docker compose exec arc-streaming bin/pulsar-admin topics \
  reset-cursor arc/agents/inference.completed \
  --subscription billing-service \
  --time "2026-01-01T00:00:00Z"

Production Notes

  • Tiered storage — offload old data to MinIO (Tardis) for long-term retention
  • Monitor backlog — growing subscription backlog indicates a consumer is behind
  • Resource usage — Pulsar is heavier than NATS; ensure 2+ GB RAM for the broker

Contributors

Changelog