Skip to content

NATS Micro input/output #594

@joeblew999

Description

@joeblew999

NATS Micro input/output

Bento has nats and nats_jetstream, but not NATS Micro.

NATS Micro adds service registration via $SRV subjects, automatic discovery (gateways find services by name, not hardcoded subjects), health checks and stats at $SRV.PING, $SRV.INFO, $SRV.STATS, and load balancing across instances with same service name.

Bento as gateway (front):

HTTP → Bento → NATS Micro request → services → reply → Bento → HTTP response

input:
  http_server:
    path: /api/extract

pipeline:
  processors:
    - nats_micro:
        urls: [nats://localhost:4222]
        service: document-processor
        endpoint: extract

output:
  http_server: {}

Bento as service (behind gateway):

HTTP → narun → NATS Micro → Bento → reply → narun → HTTP response

input:
  nats_micro:
    urls: [nats://localhost:4222]
    name: document-processor
    endpoint: extract

output:
  nats_micro: {}

Both modes can publish progress to JetStream for SSE streaming via nats2sse.

Related: narun - HTTP/gRPC gateway → NATS Micro

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgoPull requests that update Go codenew componentThis issue will be resolved with the creation of a new bento component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions