Skip to content

HttpGet

Performs one outbound HTTP GET for every triggering CloudEvent and publishes the response body as a new CloudEvent. The URL comes from the event's data or from the worker's config. HttpGet knows no venue: what it fetches, where the response goes and how it is stamped is configuration.

Property Value
Package Virtufin.Worker.HttpGet (NuGet, owner virtufin)
Engine (MIME) application/x-dotnet-dll (managed), or application/x-native-dll (NativeAOT); see Managed or native
Base class WorkerBase<JsonNode, HttpGetResult> (Worker DevKit)
Command topic wrk.httpget.command.<worker_id>
Responses com.virtufin.httpget.response on wrk.httpget.response (or the caller's replytopic, or config.publishtopic)
Errors com.virtufin.httpget.error on wrk.httpget.error

Configuration

Source Effect
Event data url The address to GET, e.g. {"url": "https://example.com/data"}. Wins over config.url.
config.url The worker's default URL, used when the event names none (a bare trigger). One of the two must give a URL, or the worker answers an error (Missing 'url' field...).
config.publishtopic Publishes the response to this topic instead of replytopic or wrk.httpget.response.
config.currencypair Copied onto the response as the same extension attribute, so several instances (one per pair) can share one publishtopic and a consumer still tells their responses apart.
config.venue Marks the response as market data from that venue (e.g. binance): stamps exchange, marketworld, marketuniverse, clocktype and eventtime. Unset, nothing is stamped. The publish topic is never parsed for this.
config.world The stamped marketworld: act (default) or hyp.<NAME>. Read only with venue.
config.marketuniverse, config.clocktype Override the stamped marketuniverse (default ALL) and clocktype (wall for act, historical for hyp.*). Read only with venue.
config.cooldownscope The cooldown this worker shares, a token ([a-z0-9-]). Default: the URL's host and port, lowercased, other characters as - (api.binance.com is api-binance-com).

The Runtime stamps each config entry onto the triggering event before the worker sees it, so configuration is per call, never process state: two workers loaded in one Runtime cannot overwrite each other's settings.

Cooldown

A failed response that carries the standard Retry-After header (a 429 or 503, or any status a server sends it with) pauses every HttpGet worker of the same cooldown scope until the moment it names. The worker stores that moment in the state store under wrk.httpget.cooldown.<scope> (service workmanager; the name comes from the virtufin.worker.httpget naming fragment the package embeds), and every worker reads it before a GET. While it lies ahead, the GET is not sent and the worker answers an error naming the moment.

One rate-limit answer therefore stops all workers calling that host at once, instead of each of them probing it again and, with some servers, prolonging a ban.

  • Only the standard header counts. No status code and no vendor header (rate-limit weights and the like) is interpreted.
  • The cooldown fails open: an unreadable key never blocks a request, a failed write only loses the pause.
  • A request that arrives during the pause is not queued; the caller asks again when it needs to.
  • Give workers one cooldownscope to pause them together across hosts (e.g. one account's limit), or separate scopes to keep workers on one host apart.

Response

  • datacontenttype is the upstream response's Content-Type (application/octet-stream if it has none).
  • data is the response body as text.
  • id, source (urn:com.virtufin:worker:httpget), type, correlationid (from the input) and time are set by WorkerBase like for every worker.

Errors

A failed GET (no URL, network or DNS error, timeout, non-2xx status, an active cooldown) never throws: the base class turns it into an error response.

{"command": "error", "success": false, "message": "GET <url> returned 500 Internal Server Error"}

There is no retry around the GET: one failed attempt gives one error event.

Managed or native

The package holds a managed and a NativeAOT build of the same worker class. Configuration is per call, so both behave identically. virtufin-worker create deploys the managed build by default: it is the simpler deployment and cannot crash the Runtime process the way native code can. Pick native (--native) only for a reason of your own, e.g. consistency with other AOT workers. See Packaging Modes.

Build and deploy: Build and deploy HttpGet.

Source and changelog: HttpGet/.