Pure functions for the FTPS file source: file selection, which failures to retry and error values. No I/O.
Pure functions for the FTPS file source: file selection, which failures to retry and error values. No I/O.
Pure functions for IMAP message parsing. No I/O, no side effects.
Pure functions for IMAP message parsing. No I/O, no side effects.
TLS trust settings shared by the SMTP and IMAP adapters, as Angus Mail session properties.
TLS trust settings shared by the SMTP and IMAP adapters, as Angus Mail session properties.
Pure functions for SMTP email preparation and validation. No I/O, no side effects.
Pure functions for SMTP email preparation and validation. No I/O, no side effects.
Pure functions for the SOAP 1.1 client: operation settings, the request envelope, reading the response or fault, which failures to retry and error values. No I/O.
The shell parses XML into elements of this shape, and serialises nothing: the envelope is built here as a string.
{:name "GetListsResult" :ns "http://tempuri.org/" :nil? false :text "" :children [element ...]}
Pure functions for the SOAP 1.1 client: operation settings, the request
envelope, reading the response or fault, which failures to retry and error
values. No I/O.
The shell parses XML into elements of this shape, and serialises nothing:
the envelope is built here as a string.
{:name "GetListsResult" :ns "http://tempuri.org/"
:nil? false :text "" :children [element ...]}Pure functions for Twilio API data transformation. No I/O, no side effects.
Pure functions for Twilio API data transformation. No I/O, no side effects.
Protocol definitions for external service adapters.
Defines three integration protocols:
Protocol definitions for external service adapters. Defines three integration protocols: - ISmtpProvider — outbound email via SMTP - IImapMailbox — inbound email via IMAP - ITwilioMessaging — Twilio SMS and WhatsApp messaging - IFileSource — remote files to import (FTPS) - ISoapClient — SOAP 1.1 operations (WCF services)
Malli validation schemas for external service adapters.
Malli validation schemas for external service adapters.
FTPS file source implementing IFileSource, on Apache Commons Net.
Explicit TLS (AUTH TLS, then PBSZ 0 and PROT P so the data channel is encrypted too), passive mode, binary transfers. One connection per call. A transient failure is retried with backoff; a 5xx reply is not.
Usage: (def source (create-ftps-source {:host "ftp.example.org" :username "import" :password "secret"})) (ports/list-files! source "/outbox" {:match #".*.csv"})
FTPS file source implementing IFileSource, on Apache Commons Net.
Explicit TLS (AUTH TLS, then PBSZ 0 and PROT P so the data channel is
encrypted too), passive mode, binary transfers. One connection per call. A
transient failure is retried with backoff; a 5xx reply is not.
Usage:
(def source (create-ftps-source {:host "ftp.example.org"
:username "import"
:password "secret"}))
(ports/list-files! source "/outbox" {:match #".*\.csv"})IMAP mailbox adapter implementing IImapMailbox.
Uses Jakarta Mail for IMAP access. Connections are opened per-call and closed in a finally block. Selection (unread, since, limit) runs as an IMAP SEARCH on envelopes; content is read only for the selected messages.
Usage: (def mailbox (create-imap-mailbox {:host "imap.gmail.com" :port 993 :username "user@gmail.com" :password "app-password" :ssl? true})) (fetch-unread! mailbox)
IMAP mailbox adapter implementing IImapMailbox.
Uses Jakarta Mail for IMAP access. Connections are opened per-call and closed
in a finally block. Selection (unread, since, limit) runs as an IMAP SEARCH on
envelopes; content is read only for the selected messages.
Usage:
(def mailbox (create-imap-mailbox
{:host "imap.gmail.com"
:port 993
:username "user@gmail.com"
:password "app-password"
:ssl? true}))
(fetch-unread! mailbox)SMTP transport adapter implementing ISmtpProvider.
Uses Jakarta Mail for SMTP communication. This adapter is positioned as a transport-level provider — independent of the email lib's higher-level abstraction (templating, job queuing, etc.).
Usage: (def provider (create-smtp-provider {:host "smtp.gmail.com" :port 587 :username "user@gmail.com" :password "app-password" :tls? true :from "no-reply@example.com"})) (send-email! provider {:to "recipient@example.com" :subject "Hello" :body "World"})
SMTP transport adapter implementing ISmtpProvider.
Uses Jakarta Mail for SMTP communication. This adapter is positioned as a
transport-level provider — independent of the email lib's higher-level
abstraction (templating, job queuing, etc.).
Usage:
(def provider (create-smtp-provider
{:host "smtp.gmail.com"
:port 587
:username "user@gmail.com"
:password "app-password"
:tls? true
:from "no-reply@example.com"}))
(send-email! provider {:to "recipient@example.com"
:subject "Hello"
:body "World"})SOAP 1.1 client implementing ISoapClient, on java.net.http and the JDK's XML parser, for WCF services.
Operations are described in config rather than read from a WSDL: WCF's defaults (SOAPAction namespace + contract + operation, request element named after the operation) cover most, and :operations sets the rest.
Usage: (def ibabs (create-soap-client {:endpoint "https://ibabs.example/api/v2/List.svc" :contract "IList" :data-namespace "http://schemas.datacontract.org/2004/07/iBabs" :retry-faults ["Unknown fault occured"] :operations {:GetListEntries {:timeout-ms 60000}}})) (ports/call! ibabs :GetLists {:Sitename "town"})
SOAP 1.1 client implementing ISoapClient, on java.net.http and the JDK's
XML parser, for WCF services.
Operations are described in config rather than read from a WSDL: WCF's
defaults (SOAPAction namespace + contract + operation, request element named
after the operation) cover most, and :operations sets the rest.
Usage:
(def ibabs (create-soap-client
{:endpoint "https://ibabs.example/api/v2/List.svc"
:contract "IList"
:data-namespace "http://schemas.datacontract.org/2004/07/iBabs"
:retry-faults ["Unknown fault occured"]
:operations {:GetListEntries {:timeout-ms 60000}}}))
(ports/call! ibabs :GetLists {:Sitename "town"})Twilio messaging adapter implementing ITwilioMessaging.
Uses clj-http with Basic auth (account-sid + auth-token). SMS and WhatsApp share the same Messages endpoint; the only difference is the whatsapp: prefix added by core/twilio.
Usage: (def twilio (create-twilio-adapter {:account-sid "ACxxx" :auth-token "token" :from-number "+15005550006"})) (send-sms! twilio {:to "+31612345678" :body "Hello!"})
Twilio messaging adapter implementing ITwilioMessaging.
Uses clj-http with Basic auth (account-sid + auth-token).
SMS and WhatsApp share the same Messages endpoint; the only difference
is the whatsapp: prefix added by core/twilio.
Usage:
(def twilio (create-twilio-adapter
{:account-sid "ACxxx"
:auth-token "token"
:from-number "+15005550006"}))
(send-sms! twilio {:to "+31612345678" :body "Hello!"})Integrant lifecycle wiring for the external service adapters.
Registers init-key and halt-key! multimethods for: :wagoe.external/smtp — SMTP transport provider :wagoe.external/imap — IMAP mailbox reader :wagoe.external/twilio — Twilio SMS / WhatsApp :wagoe.external/ftps — FTPS file source :wagoe.external/soap — SOAP 1.1 client
All five keys are opt-in: add them to :active in config.edn to enable. They are shipped in :inactive by default.
Integrant lifecycle wiring for the external service adapters. Registers init-key and halt-key! multimethods for: :wagoe.external/smtp — SMTP transport provider :wagoe.external/imap — IMAP mailbox reader :wagoe.external/twilio — Twilio SMS / WhatsApp :wagoe.external/ftps — FTPS file source :wagoe.external/soap — SOAP 1.1 client All five keys are opt-in: add them to :active in config.edn to enable. They are shipped in :inactive by default.
No vars found in this namespace.
Retry and circuit breaker for the SMTP, IMAP and Twilio adapters, on the
same layer as the RPC client (wagoe.platform.resilience).
Both are opt-in. :retries retries only a call that never connected, since
one that connected may have sent the message. Off by default: these adapters
set no connect timeout, so an attempt against a host that drops packets can
take minutes. Pass a :cache for the breaker; it counts calls that got no
answer — never connected, or timed out.
Retry and circuit breaker for the SMTP, IMAP and Twilio adapters, on the same layer as the RPC client (`wagoe.platform.resilience`). Both are opt-in. `:retries` retries only a call that never connected, since one that connected may have sent the message. Off by default: these adapters set no connect timeout, so an attempt against a host that drops packets can take minutes. Pass a `:cache` for the breaker; it counts calls that got no answer — never connected, or timed out.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |