amqp10

Generated by tinox doc

tinox.core.amqp10, split out of the bundled stdlib as a standalone tinox-central package.

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

connInt64
maxFrameSizeInt64
channelMaxInt64
errorMessageString
hostString
portInt64
userString
passString
idleTimeoutMsInt64
heartbeatRunningBool
heartbeatHandleInt64
nextChannelIdInt64

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

descriptorInt64
valueAmqp10Value

class Amqp10Frame

Fields

frameTypeInt64
chanIdInt64
bodyList<Int64>

class Amqp10Message

Fields

bodyList<Int64>
contentTypeString
deliveryIdInt64
okBool
errorMessageString

class Amqp10Performative

Fields

descriptorInt64
fieldsList<Amqp10Value>

fn tinoxBytesToString(bytes: List<Int64>) → String

class Amqp10Reader

Fields

bytesList<Int64>
posInt64
truncatedBool

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

okBool
errorMessageString

class Amqp10Session

Fields

connInt64
chanIdInt64
maxFrameSizeInt64
errorMessageString
nextLinkHandleInt64

Methods

fn begin(connection: Amqp10Connection) → Amqp10Session
fn end() → Nothing

class Amqp10Transaction

Fields

txnIdList<Int64>
okBool
errorMessageString

class Amqp10Writer

Fields

bytesList<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