What the Anypoint MQ step (AnypointMq.Broker) and the Anypoint MQ
source (AnypointMq.Source) share about the broker's REST API: the
broker URL's check, a path segment's encoding and limit, the token of the
tenant's auth profile for a call (Plugin.Provisional.Credentials), and
reading and decoding the broker's answers.
Summary
Functions
A received message's body as text: the JSON of one the broker sent as a value.
url as a broker URL: http or https, a host, no query or fragment,
without a trailing /; {:error, message} otherwise.
An answer's text as JSON: {:ok, nil} when empty, {:error, message}
(a fragment after "the broker's answer to …") when it is not JSON.
value as one URL path segment.
An integer, or one written as text; nil otherwise.
The longest a value that goes into the URL as one path segment may be, in bytes.
An answer's body read whole and released.
The most bytes of a receive's answer a call reads (Outbound.call/3's
cap), whatever the batch: room for one of the broker's largest
messages, escaped, about 30 MiB, more than the 16 MiB default
(Outbound.max_response_bytes/0). A batch whose answer is larger fails
response_too_large: a source trigger then asks for fewer messages,
a consume step's author lowers its batch_size. Sized for the batch
instead, ten messages would be read whole at about 300 MiB.
Whether a received entry can be settled: an object whose headers carry
its messageId and its lockId.
The start of an answer's text for a message, after a :; empty when there is none.
A map's keys as text; an empty map for anything else.
The Authorization value of the tenant's auth profile for a call to
url (Credentials.for_call/3), renew the value a first call was
answered 401 with (nil for a first call): {:ok, value, outbound_us},
or {:error, message, outbound_us} naming what to set up.
Functions
A received message's body as text: the JSON of one the broker sent as a value.
url as a broker URL: http or https, a host, no query or fragment,
without a trailing /; {:error, message} otherwise.
An answer's text as JSON: {:ok, nil} when empty, {:error, message}
(a fragment after "the broker's answer to …") when it is not JSON.
value as one URL path segment.
An integer, or one written as text; nil otherwise.
@spec max_segment() :: pos_integer()
The longest a value that goes into the URL as one path segment may be, in bytes.
An answer's body read whole and released.
@spec receive_cap() :: pos_integer()
The most bytes of a receive's answer a call reads (Outbound.call/3's
cap), whatever the batch: room for one of the broker's largest
messages, escaped, about 30 MiB, more than the 16 MiB default
(Outbound.max_response_bytes/0). A batch whose answer is larger fails
response_too_large: a source trigger then asks for fewer messages,
a consume step's author lowers its batch_size. Sized for the batch
instead, ten messages would be read whole at about 300 MiB.
Whether a received entry can be settled: an object whose headers carry
its messageId and its lockId.
The start of an answer's text for a message, after a :; empty when there is none.
A map's keys as text; an empty map for anything else.
@spec token(map(), String.t(), String.t() | nil) :: {:ok, String.t(), non_neg_integer()} | {:error, String.t(), non_neg_integer()}
The Authorization value of the tenant's auth profile for a call to
url (Credentials.for_call/3), renew the value a first call was
answered 401 with (nil for a first call): {:ok, value, outbound_us},
or {:error, message, outbound_us} naming what to set up.