Class: Destination

vertx-stomp-js/destination~ Destination

new Destination()

Represents a STOMP destination. Depending on the implementation, the message delivery is different. Queue are sending message to only one subscribers, while topics are broadcasting the message to all subscribers.

Implementations must be thread-safe.

Source:

Methods

ack(connection, frame) → {boolean}

Handles a ACK frame.
Parameters:
Name Type Description
connection StompServerConnection the connection
frame Object the ACK frame
Source:
Returns:
true if the destination has handled the frame (meaning it has sent the message with id)
Type
boolean

destination() → {string}

Source:
Returns:
the destination address.
Type
string

dispatch(connection, frame) → {Destination}

Dispatches the given frame.
Parameters:
Name Type Description
connection StompServerConnection the connection
frame Object the frame
Source:
Returns:
the current instance of Destination
Type
Destination

getSubscriptions(connection) → {Array.<string>}

Gets all subscription ids for the given destination hold by the given client
Parameters:
Name Type Description
connection StompServerConnection the connection (client)
Source:
Returns:
the list of subscription id, empty if none
Type
Array.<string>

matches(address) → {boolean}

Checks whether or not the given address matches with the current destination.
Parameters:
Name Type Description
address string the address
Source:
Returns:
true if it matches, false otherwise.
Type
boolean

nack(connection, frame) → {boolean}

Handles a NACK frame.
Parameters:
Name Type Description
connection StompServerConnection the connection
frame Object the NACK frame
Source:
Returns:
true if the destination has handled the frame (meaning it has sent the message with id)
Type
boolean

numberOfSubscriptions() → {number}

Gets the number of subscriptions attached to the current Destination.
Source:
Returns:
the number of subscriptions.
Type
number

subscribe(connection, frame) → {Destination}

Handles a subscription request to the current Destination.
Parameters:
Name Type Description
connection StompServerConnection the connection
frame Object the SUBSCRIBE frame
Source:
Returns:
the current instance of Destination
Type
Destination

unsubscribe(connection, frame) → {boolean}

Handles a un-subscription request to the current Destination.
Parameters:
Name Type Description
connection StompServerConnection the connection
frame Object the UNSUBSCRIBE frame
Source:
Returns:
true if the un-subscription has been handled, false otherwise.
Type
boolean

unsubscribeConnection(connection) → {Destination}

Removes all subscriptions of the given connection
Parameters:
Name Type Description
connection StompServerConnection the connection
Source:
Returns:
the current instance of Destination
Type
Destination