object
stomp
Portable STOMP 1.2 (Simple Text Orientated Messaging Protocol) client. Uses the sockets library for TCP communication.
logtalk_load(stomp(loader))static, context_switching_calls
Supported backends: ECLiPSe, GNU Prolog, SICStus Prolog, and SWI-Prolog (same as the sockets library).
Protocol version: Implements STOMP 1.2 specification.
Heartbeat: Supports heartbeat negotiation. Automatic heartbeat sending is not implemented; use send_heartbeat/1 manually if needed.
Subscriptions: Supports multiple concurrent subscriptions with unique IDs.
Transactions: Supports STOMP transactions with BEGIN, COMMIT, and ABORT.
Frame encoding: Properly encodes/decodes header values according to STOMP 1.2 escaping rules.
Public predicates
connect/4
Connects to a STOMP server and performs the STOMP handshake. Returns a connection handle for subsequent operations.
staticconnect(Host,Port,Connection,Options)connect(+atom,+integer,--compound,+list) - one_or_errorstomp_error(connection_failed)stomp_error(protocol_error(Message))
Option login(Login): Username for authentication.
Option passcode(Passcode): Password for authentication.
Option host(VirtualHost): Virtual host name. Defaults to the Host parameter.
Option heartbeat(ClientMs, ServerMs): Heartbeat timing in milliseconds. Default is 0,0 (no heartbeat).
disconnect/2
Gracefully disconnects from the STOMP server. Sends DISCONNECT frame and waits for RECEIPT if requested.
staticdisconnect(Connection,Options)disconnect(+compound,+list) - one_or_error
Option receipt(ReceiptId): Request receipt confirmation. Automatically generated if not specified.
connection_alive/1
Checks if the connection is still open and valid.
staticconnection_alive(Connection)connection_alive(+compound) - zero_or_onesend/4
Sends a message to the specified destination.
staticsend(Connection,Destination,Body,Options)send(+compound,+atom,+term,+list) - one_or_error
Option content_type(MimeType): MIME type of the body.
Option content_length(Length): Body length in bytes. Auto-calculated if omitted for atom/string bodies.
Option transaction(TransactionId): Include message in the named transaction.
Option receipt(ReceiptId): Request receipt confirmation.
Option header(Name, Value): Add custom header (can be repeated).
subscribe/4
Subscribes to a destination to receive messages.
staticsubscribe(Connection,Destination,SubscriptionId,Options)subscribe(+compound,+atom,+atom,+list) - one_or_error
Option ack(Mode): Acknowledgment mode: auto (default), client, or client_individual.
unsubscribe/3
Unsubscribes from a destination.
staticunsubscribe(Connection,SubscriptionId,Options)unsubscribe(+compound,+atom,+list) - one_or_errorreceive/3
Receives a frame from the server. Returns MESSAGE, RECEIPT, or ERROR frames.
staticreceive(Connection,Frame,Options)receive(+compound,-compound,+list) - zero_or_one_or_error
Option timeout(Milliseconds): Timeout in milliseconds. 0 for non-blocking, -1 for infinite wait. Default is -1.
ack/3
Acknowledges receipt of a message.
staticack(Connection,AckId,Options)ack(+compound,+atom,+list) - one_or_error
Option transaction(TransactionId): Include acknowledgment in the named transaction.
nack/3
Negatively acknowledges a message (tells server the message was not consumed).
staticnack(Connection,AckId,Options)nack(+compound,+atom,+list) - one_or_error
Option transaction(TransactionId): Include negative acknowledgment in the named transaction.
begin_transaction/3
Begins a new transaction.
staticbegin_transaction(Connection,TransactionId,Options)begin_transaction(+compound,+atom,+list) - one_or_errorcommit_transaction/3
Commits a transaction, making all its operations permanent.
staticcommit_transaction(Connection,TransactionId,Options)commit_transaction(+compound,+atom,+list) - one_or_errorabort_transaction/3
Aborts a transaction, rolling back all its operations.
staticabort_transaction(Connection,TransactionId,Options)abort_transaction(+compound,+atom,+list) - one_or_errorsend_heartbeat/1
Sends a heartbeat (EOL) to the server to keep the connection alive.
staticsend_heartbeat(Connection)send_heartbeat(+compound) - one_or_errorframe_command/2
Extracts the command from a frame.
staticframe_command(Frame,Command)frame_command(+compound,-atom) - oneframe_header/3
Extracts a header value from a frame. Fails if header is not present.
staticframe_header(Frame,HeaderName,Value)frame_header(+compound,+atom,-atom) - zero_or_oneframe_headers/2
Extracts all headers from a frame as a list of Name-Value pairs.
staticframe_headers(Frame,Headers)frame_headers(+compound,-list) - oneframe_body/2
Extracts the body from a frame. Returns empty atom if no body.
staticframe_body(Frame,Body)frame_body(+compound,-term) - oneProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)