amqp10
Generated by tinox doc
Standalone AMQP-1.0 client (no shared code with amqp091 -- a different type system and a three-tier Connection -> Session -> Link hierarchy with credit-based flow control instead of 0-9-1's Connection/Channel model). Links are explicitly sender- or receiver-role; use it to talk to AMQP-1.0 brokers/routers such as ActiveMQ Artemis or Azure Service Bus.
| Module | Version | Group |
|---|---|---|
base64 | 1.0.0 | tinox.core |
socket | 1.0.0 | tinox.core |
Publish and consume
import tinox.core.amqp10;
class Main
{
fnc main() -> Int32
{
let conn: Amqp10Connection = Amqp10Connection::connect("localhost", 5672, "guest", "guest");
let session: Amqp10Session = Amqp10Session::begin(conn);
// role=false is a sender link (target = the destination address)
let sender: Amqp10Link = Amqp10Link::attach(session, "publisher", false, "orders");
sender.publish(Amqp10::stringToBytes("hello amqp-1.0"), "text/plain");
// role=true is a receiver link (source = where messages come from)
let receiver: Amqp10Link = Amqp10Link::attach(session, "consumer", true, "orders");
receiver.grantCredit(1);
let msg: Amqp10Message = receiver.nextMessage();
if msg.ok
{
println(tinoxBytesToString(msg.body));
receiver.ack(msg.deliveryId);
}
session.end();
conn.close();
return 0;
}
}
fn tinoxBytesToString(bytes: List<Int64>) → String
class Amqp10
Methods
fn dial(host: String, port: Int64) → Int64
fn dialTls(host: String, port: Int64, verify: Bool) → Int64
fn sendAmqpProtocolHeader(conn: Int64) → Nothing
fn sendSaslProtocolHeader(conn: Int64) → Nothing
fn checkProtocolHeaderEcho(conn: Int64, sent: List<Int64>) → Bool
fn readFrame(conn: Int64) → Amqp10Frame
fn readFrameSkipHeartbeats(conn: Int64) → Amqp10Frame
fn writeFrame(conn: Int64, frameType: Int64, chanId: Int64, body: List<Int64>) → Nothing
fn encodePerformative(descriptorCode: Int64, fields: List<Amqp10Value>) → List<Int64>
fn decodePerformative(body: List<Int64>) → Amqp10Performative
fn encodeMessageBody(body: List<Int64>, contentType: String) → List<Int64>
fn deliveryTagBytes(n: Int64) → List<Int64>
fn saslPlainResponse(user: String, pass: String) → List<Int64>
fn negotiateSasl(conn: Int64, user: String, pass: String) → Amqp10SaslResult
fn stringToBytes(s: String) → List<Int64>
fn bytesToString(b: List<Int64>) → String
fn xorBytes(a: List<Int64>, b: List<Int64>) → List<Int64>
fn pbkdf2HmacSha256(password: List<Int64>, salt: List<Int64>, iterations: Int64) → List<Int64>
fn generateScramNonce() → String
fn negotiateSaslScram(conn: Int64, user: String, pass: String) → Amqp10SaslResult
class Amqp10Connection
Fields
conn | Int64 | |
maxFrameSize | Int64 | |
channelMax | Int64 | |
errorMessage | String | |
host | String | |
port | Int64 | |
user | String | |
pass | String | |
idleTimeoutMs | Int64 | |
heartbeatRunning | Bool | |
heartbeatHandle | Int64 | |
nextChannelId | Int64 |
Methods
fn connect(host: String, port: Int64, user: String, pass: String) → Amqp10Connection
fn connectTls(host: String, port: Int64, user: String, pass: String, verify: Bool) → Amqp10Connection
fn negotiateOnConn(conn: Int64, host: String, port: Int64, user: String, pass: String) → Amqp10Connection
fn sendHeartbeat() → Nothing
fn startHeartbeat(intervalMs: Int64) → Nothing
fn stopHeartbeat() → Nothing
fn close() → Nothing
fn reconnect() → Amqp10Connection
fnc amqp10HeartbeatLoop(conn: Amqp10Connection, intervalMs: Int64) → Int64
class Amqp10Described
Fields
descriptor | Int64 | |
value | Amqp10Value |
class Amqp10Frame
Fields
frameType | Int64 | |
chanId | Int64 | |
body | List<Int64> |
class Amqp10Link
Fields
conn | Int64 | |
chanId | Int64 | |
handle | Int64 | |
maxFrameSize | Int64 | |
linkCredit | Int64 | |
deliveryCount | Int64 | |
errorMessage | String | |
recoveredUnsettledTags | List<List<Int64>> |
Methods
fn attach(session: Amqp10Session, name: String, role: Bool, address: String) → Amqp10Link
fn attachWithRecovery(session: Amqp10Session, name: String, role: Bool, address: String, priorUnsettledTags: List<List<Int64>>) → Amqp10Link
fn attachCore(session: Amqp10Session, name: String, role: Bool, address: String, priorUnsettledTags: List<List<Int64>>) → Amqp10Link
fn detach() → Nothing
fn awaitFlow() → Nothing
fn grantCredit(amount: Int64) → Nothing
fn publish(body: List<Int64>, contentType: String) → Nothing
fn publishTransactional(body: List<Int64>, contentType: String, txnId: List<Int64>) → Nothing
fn publishCore(body: List<Int64>, contentType: String, txnState: Amqp10Value) → Nothing
fn nextMessage() → Amqp10Message
fn sendDisposition(deliveryId: Int64, state: Amqp10Value) → Nothing
fn ack(deliveryId: Int64) → Nothing
fn reject(deliveryId: Int64, condition: String, description: String) → Nothing
fn release(deliveryId: Int64) → Nothing
fn modify(deliveryId: Int64, deliveryFailed: Bool, undeliverableHere: Bool) → Nothing
fn ackTransactional(deliveryId: Int64, txnId: List<Int64>) → Nothing
fn attachCoordinator(session: Amqp10Session, name: String) → Amqp10Link
fn sendCoordinatorControl(controlValue: Amqp10Value) → Amqp10Value
fn declare() → Amqp10Transaction
fn discharge(txnId: List<Int64>, fail: Bool) → Bool
class Amqp10Message
Fields
body | List<Int64> | |
contentType | String | |
deliveryId | Int64 | |
ok | Bool | |
errorMessage | String |
class Amqp10Performative
Fields
descriptor | Int64 | |
fields | List<Amqp10Value> |
fn tinoxBytesToString(bytes: List<Int64>) → String
class Amqp10Reader
Fields
bytes | List<Int64> | |
pos | Int64 | |
truncated | Bool |
Methods
fn new(bytes: List<Int64>) → Amqp10Reader
fn remaining() → Int64
fn readU8() → Int64
fn readU16() → Int64
fn readU32() → Int64
fn readU64() → Int64
fn toSigned8(v: Int64) → Int64
fn toSigned16(v: Int64) → Int64
fn toSigned32(v: Int64) → Int64
fn readRawStr(n: Int64) → String
fn readRawBytes(n: Int64) → List<Int64>
fn readValueOfCode(code: Int64) → Amqp10Value
fn readValue() → Amqp10Value
fn readList(size: Int64, count: Int64) → Amqp10Value
fn readMap(size: Int64, count: Int64) → Amqp10Value
fn readArray(size: Int64, count: Int64) → Amqp10Value
fn readDescribed() → Amqp10Value
class Amqp10SaslResult
Fields
ok | Bool | |
errorMessage | String |
class Amqp10Session
Fields
conn | Int64 | |
chanId | Int64 | |
maxFrameSize | Int64 | |
errorMessage | String | |
nextLinkHandle | Int64 |
Methods
fn begin(connection: Amqp10Connection) → Amqp10Session
fn end() → Nothing
class Amqp10Transaction
Fields
txnId | List<Int64> | |
ok | Bool | |
errorMessage | String |
class Amqp10Writer
Fields
bytes | List<Int64> |
Methods
fn new() → Amqp10Writer
fn pushU8(v: Int64) → Nothing
fn pushU16(v: Int64) → Nothing
fn pushU32(v: Int64) → Nothing
fn pushU64(v: Int64) → Nothing
fn pushRawStr(s: String) → Nothing
fn pushRawBytes(data: List<Int64>) → Nothing
fn writeNull() → Nothing
fn writeBoolean(v: Bool) → Nothing
fn writeUbyte(v: Int64) → Nothing
fn writeUshort(v: Int64) → Nothing
fn writeUint(v: Int64) → Nothing
fn writeUlong(v: Int64) → Nothing
fn writeByte(v: Int64) → Nothing
fn writeShort(v: Int64) → Nothing
fn writeInt(v: Int64) → Nothing
fn writeLong(v: Int64) → Nothing
fn writeChar(v: Int64) → Nothing
fn writeTimestamp(v: Int64) → Nothing
fn writeUuid(uuidBytes: List<Int64>) → Nothing
fn writeBinary(data: List<Int64>) → Nothing
fn writeString(s: String) → Nothing
fn writeSymbol(s: String) → Nothing
fn writeList(items: List<Amqp10Value>) → Nothing
fn writeMap(pairs: List<Amqp10Value>) → Nothing
fn writeDescribed(d: Amqp10Described) → Nothing
fn writeValue(v: Amqp10Value) → Nothing