pub enum ToServer {
Send {
destination: String,
transaction: Option<String>,
headers: Option<Vec<(String, String)>>,
body: Option<Vec<u8>>,
},
Subscribe {
destination: String,
id: String,
ack: Option<AckMode>,
},
Unsubscribe {
id: String,
},
Ack {
id: String,
transaction: Option<String>,
},
Nack {
id: String,
transaction: Option<String>,
},
Begin {
transaction: String,
},
Commit {
transaction: String,
},
Abort {
transaction: String,
},
Disconnect {
receipt: Option<String>,
},
// some variants omitted
}
Expand description
A STOMP message sent by the client
This enum represents all possible message types that can be sent to a STOMP server according to the STOMP 1.2 specification.
See the STOMP 1.2 Specification for more detailed information about each message type.
Variants§
Send
Send a message to a destination in the messaging system
Used to send a message to a specific destination like a queue or topic.
Fields
Subscribe
Register to listen to a given destination
Creates a subscription to receive messages from a specific destination.
Fields
Unsubscribe
Remove an existing subscription
Cancels a subscription so the client stops receiving messages from it.
Ack
Acknowledge consumption of a message from a subscription
Used with ‘client’ or ‘client-individual’ acknowledgment modes to confirm successful processing of a message.
Fields
Nack
Notify the server that the client did not consume the message
Used with ‘client’ or ‘client-individual’ acknowledgment modes to indicate that a message could not be processed successfully.
Fields
Begin
Start a transaction
Begins a new transaction that can group multiple STOMP operations.
Commit
Commit an in-progress transaction
Completes a transaction and applies all its operations.
Abort
Roll back an in-progress transaction
Cancels a transaction and rolls back all its operations.
Disconnect
Gracefully disconnect from the server
Cleanly ends the STOMP session. Clients MUST NOT send any more frames after the DISCONNECT frame is sent.