### STOMP BEGIN Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Shows a client's BEGIN frame to initiate a transaction, identified by a unique transaction ID. ```STOMP BEGIN transaction:tx1 ``` -------------------------------- ### STOMP CONNECT Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Demonstrates a client's CONNECT frame to initiate a STOMP session, specifying accepted protocol versions, host, login credentials, and heart-beat settings. ```STOMP CONNECT accept-version:1.0,1.1,2.0 host:stomp.example.com login:peter@parker.com passcode:maryjane heart-beat:0,0 ``` -------------------------------- ### STOMP ERROR Frame Example (Protocol Version) Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt An example of a server's ERROR frame indicating a protocol version mismatch or unsupported versions, providing a plain text message body. ```STOMP ERROR version:1.2,2.1 content-type:text/plain Supported protocol versions are 1.2 2.1 ``` -------------------------------- ### STOMP Client Frame Example (Alternative Connect) Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Illustrates a client's STOMP frame, similar to CONNECT, for initiating a session with protocol version negotiation, host, authentication, and heart-beat configuration. ```STOMP STOMP accept-version:1.0,1.1,2.0 host:stomp.example.com login:peter@parker.com passcode:maryjane heart-beat:0,0 ``` -------------------------------- ### STOMP CONNECT Frame Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/CONNECT.golden.txt An example of a STOMP CONNECT frame used by a client to initiate a connection to a STOMP broker. It specifies the acceptable STOMP protocol versions, heart-beat settings, the virtual host, and authentication credentials (login and passcode). ```STOMP CONNECT accept-version:1.0,1.1,2.0 heart-beat:0,0 host:stomp.example.com login:peter@parker.com passcode:maryjane ``` -------------------------------- ### STOMP ERROR Frame Example (Malformed Frame) Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt An example of a server's ERROR frame indicating a malformed client frame, providing details about the error, the problematic frame, and the reason for the failure. ```STOMP ERROR receipt-id:message-12345 content-type:text/plain content-length:170 message:malformed frame received The message: ===== MESSAGE destined:/queue/a receipt:message-12345 Hello queue a! ===== Did not contain a destination header, which is REQUIRED for message propagation. ``` -------------------------------- ### STOMP ERROR Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/server/ERROR_2.golden.txt An example of a STOMP ERROR frame received, indicating a malformed frame and providing details such as content-length, content-type, message, and receipt-id. ```APIDOC ERROR content-length:170 content-type:text/plain message:malformed frame received receipt-id:message-12345 ``` -------------------------------- ### STOMP UNSUBSCRIBE Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Shows a client's UNSUBSCRIBE frame to terminate an existing subscription, identified by its unique ID. ```STOMP UNSUBSCRIBE id:0 ``` -------------------------------- ### STOMP SEND Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Demonstrates a client's SEND frame to publish a message to a destination, including transaction ID and content type, with a plain text body. ```STOMP SEND destination:/queue/a transaction:tx10 content-type:text/plain hello queue a ``` -------------------------------- ### STOMP SUBSCRIBE Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Illustrates a client's SUBSCRIBE frame to register for messages from a specific destination, specifying a unique subscription ID and acknowledgment mode. ```STOMP SUBSCRIBE id:0 destination:/queue/foo ack:client ``` -------------------------------- ### STOMP CONNECTED Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Shows a server's CONNECTED frame response, confirming a successful STOMP session establishment, including the negotiated protocol version, server identifier, session ID, and heart-beat settings. ```STOMP CONNECTED version:1.1 server:Apache/1.3.9 session:78 heart-beat:0,0 ``` -------------------------------- ### STOMP COMMIT Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Demonstrates a client's COMMIT frame to finalize a transaction, making all operations within it permanent, identified by its transaction ID. ```STOMP COMMIT transaction:tx1 ``` -------------------------------- ### Start stompd STOMP server/broker Source: https://github.com/tjs-w/go-proto-stomp/blob/main/README.md This command initiates the `stompd` STOMP server, also known as the broker. It specifies TCP as the transport protocol and requires the host and port where the server will listen for incoming connections. ```shell stompd -t tcp ``` -------------------------------- ### STOMP RECEIPT Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Demonstrates a server's RECEIPT frame response, confirming the processing of a client frame that requested a receipt, identified by the receipt ID. ```STOMP RECEIPT receipt-id:77 ``` -------------------------------- ### STOMP CONNECT Frame Header Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/STOMP.golden.txt An example of the headers sent by a client in a STOMP CONNECT frame. This includes the 'accept-version' header to specify supported protocol versions, 'heart-beat' for connection liveness, 'host' for virtual host routing, and 'login'/'passcode' for authentication. ```STOMP STOMP accept-version:1.0,1.1,2.0 heart-beat:0,0 host:stomp.example.com login:peter@parker.com passcode:maryjane ``` -------------------------------- ### STOMP DISCONNECT Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Shows a client's DISCONNECT frame to gracefully close a STOMP session, optionally requesting a receipt for confirmation. ```STOMP DISCONNECT receipt:77 ``` -------------------------------- ### STOMP ACK Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Demonstrates a client's ACK frame to acknowledge the consumption of a message, identified by its message ID, optionally within a transaction. ```STOMP ACK id:12345 transaction:tx1 ``` -------------------------------- ### Malformed STOMP MESSAGE Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/server/ERROR_2.golden.txt An example of a STOMP MESSAGE frame that is malformed due to the absence of a required 'destination' header, despite containing other headers like 'destined' and 'receipt', and a body. ```APIDOC MESSAGE destined:/queue/a receipt:message-12345 Hello queue a! ``` -------------------------------- ### STOMP MESSAGE Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Illustrates a server's MESSAGE frame delivering content to a subscribed client, including subscription ID, message ID, destination, content type, and acknowledgment ID, with a plain text body. ```STOMP MESSAGE subscription:0 message-id:007 destination:/queue/a content-type:text/plain ack:1 hello queue a ``` -------------------------------- ### STOMP ABORT Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Illustrates a client's ABORT frame to roll back a transaction, undoing all operations within it, identified by its transaction ID. ```STOMP ABORT transaction:tx1 ``` -------------------------------- ### STOMP MESSAGE Frame Structure Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/server/MESSAGE.golden.txt A sample STOMP MESSAGE frame, demonstrating the structure with headers like 'ack', 'content-type', 'destination', 'message-id', and 'subscription', followed by the message body. This frame indicates a message received on '/queue/a'. ```STOMP MESSAGE ack:1 content-type:text/plain destination:/queue/a message-id:007 subscription:0 hello queue a ``` -------------------------------- ### STOMP NACK Frame Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames.golden.txt Illustrates a client's NACK frame to negatively acknowledge a message, indicating it was not consumed, identified by its message ID, optionally within a transaction. ```STOMP NACK id:12345 transaction:tx1 ``` -------------------------------- ### STOMP ABORT Command Example Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/ABORT.golden.txt Demonstrates the STOMP ABORT command used to roll back a transaction. The 'transaction' header specifies the ID of the transaction to abort, ensuring that all messages sent or acknowledged within that transaction are discarded. ```STOMP ABORT transaction:tx1 ``` -------------------------------- ### STOMP NACK Frame with Transaction Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/NACK.golden.txt The NACK frame in STOMP is used by a client to inform the broker that it could not process a received message. This specific example includes an 'id' header to identify the message being rejected and a 'transaction' header, indicating that the NACK operation is part of an ongoing transaction. This allows for transactional message handling, where the message might be redelivered or handled differently based on the broker's policy. ```STOMP NACK id:12345 transaction:tx1 ``` -------------------------------- ### STOMP SUBSCRIBE Frame with Client Acknowledgment Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/SUBSCRIBE.golden.txt This snippet demonstrates a basic STOMP SUBSCRIBE frame. It is used to subscribe to the '/queue/foo' destination, requiring client acknowledgment for messages received on this subscription. The 'id' header uniquely identifies this subscription. ```STOMP SUBSCRIBE ack:client destination:/queue/foo id:0 ``` -------------------------------- ### Send Message to STOMP Queue with Transaction Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/SEND.golden.txt This STOMP frame sends a plain text message to the '/queue/a' destination. It includes a 'transaction' header, indicating that the message is part of a transaction named 'tx10'. The 'content-type' header specifies the message body is plain text, ensuring proper interpretation by the receiving client. ```STOMP SEND content-type:text/plain destination:/queue/a transaction:tx10 hello queue a ``` -------------------------------- ### STOMP UNSUBSCRIBE Frame Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/UNSUBSCRIBE.golden.txt A basic STOMP UNSUBSCRIBE frame. The 'id' header specifies the subscription to be unsubscribed from. This command is used by a client to stop receiving messages from a destination, effectively ending the flow of messages for that subscription. ```STOMP UNSUBSCRIBE id:0 ``` -------------------------------- ### Basic STOMP RECEIPT Frame Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/server/RECEIPT.golden.txt This snippet displays a fundamental STOMP RECEIPT frame. A server sends this frame to a client to confirm that a previously sent client frame (which included a 'receipt' header) has been successfully processed. The 'receipt-id' header in the RECEIPT frame matches the value of the 'receipt' header from the original client frame. ```STOMP RECEIPT receipt-id:77 ``` -------------------------------- ### STOMP DISCONNECT Frame with Receipt Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/DISCONNECT.golden.txt A STOMP DISCONNECT frame sent by a client to signal its intention to close the connection. The 'receipt' header ensures the server acknowledges the disconnection by sending a RECEIPT frame back, confirming the operation's completion. ```STOMP DISCONNECT receipt:77 ``` -------------------------------- ### STOMP ACK Frame Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/ACK.golden.txt This snippet illustrates a basic STOMP ACK frame. The ACK frame is sent by a client to acknowledge the consumption of a message. It typically includes an 'id' header to identify the message being acknowledged and an optional 'transaction' header if the acknowledgment is part of a transaction, ensuring reliable message processing. ```STOMP Protocol ACK id:12345 transaction:tx1 ``` -------------------------------- ### Fetch go-proto-stomp Go module Source: https://github.com/tjs-w/go-proto-stomp/blob/main/README.md This command uses the Go module system to download and update the `go-proto-stomp` module. The `-u` flag ensures that all dependencies are also updated to their latest compatible versions, preparing the module for use in a Go project. ```shell go get -u github.com/tjs-w/go-proto-stomp ``` -------------------------------- ### Run stomper interactive STOMP client CLI Source: https://github.com/tjs-w/go-proto-stomp/blob/main/README.md This command launches the `stomper` interactive STOMP client, configured to use TCP as its transport. It enables users to connect to and interact with a STOMP broker directly from the command line. ```shell stomper -t tcp ``` -------------------------------- ### STOMP: Begin a Transaction Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/BEGIN.golden.txt Initiates a new transaction in the STOMP protocol. The `transaction` header specifies a unique identifier for the transaction. Messages sent or acknowledged within this transaction ID will be grouped together, allowing for atomic operations that can be committed or aborted later. ```STOMP BEGIN transaction:tx1 ``` -------------------------------- ### Import stomp package in Go application Source: https://github.com/tjs-w/go-proto-stomp/blob/main/README.md This Go import statement makes the `stomp` package available within a Go source file. It allows developers to access and utilize the STOMP client and broker functionalities provided by the `go-proto-stomp` library in their applications. ```go import "github.com/tjs-w/go-proto-stomp/pkg/stomp" ``` -------------------------------- ### STOMP Protocol Frame Augmented BNF Specification Source: https://github.com/tjs-w/go-proto-stomp/blob/main/README.md This section provides the Augmented BNF (Backus-Naur Form) grammar that defines the structure and syntax of STOMP frames. This specification is strictly followed for frame construction and validation within the `go-proto-stomp` implementation, ensuring adherence to the STOMP 1.2 protocol. ```APIDOC NULL = LF = CR = EOL = [CR] LF OCTET = frame-stream = 1*frame frame = command EOL *( header EOL ) EOL *OCTET NULL *( EOL ) command = client-command | server-command client-command = "SEND" | "SUBSCRIBE" | "UNSUBSCRIBE" | "BEGIN" | "COMMIT" | "ABORT" | "ACK" | "NACK" | "DISCONNECT" | "CONNECT" | "STOMP" server-command = "CONNECTED" | "MESSAGE" | "RECEIPT" | "ERROR" header = header-name ":" header-value header-name = 1* header-value = * ``` -------------------------------- ### STOMP Commit Transaction Source: https://github.com/tjs-w/go-proto-stomp/blob/main/pkg/stomp/testdata/frames/client/COMMIT.golden.txt Demonstrates the STOMP COMMIT command used to finalize a transaction. The 'transaction' header specifies the unique identifier of the transaction to be committed, in this case 'tx1'. ```STOMP COMMIT transaction:tx1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.