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
ACKframe.Parameters:
Name Type Description connectionStompServerConnection the connection frameObject the ACKframe- Source:
Returns:
trueif 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 connectionStompServerConnection the connection frameObject 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 connectionStompServerConnection 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 addressstring the address - Source:
Returns:
trueif it matches,falseotherwise.- Type
- boolean
-
nack(connection, frame) → {boolean}
-
Handles a
NACKframe.Parameters:
Name Type Description connectionStompServerConnection the connection frameObject the NACKframe- Source:
Returns:
trueif 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 connectionStompServerConnection the connection frameObject the SUBSCRIBEframe- 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 connectionStompServerConnection the connection frameObject the UNSUBSCRIBEframe- Source:
Returns:
trueif the un-subscription has been handled,falseotherwise.- Type
- boolean
-
unsubscribeConnection(connection) → {Destination}
-
Removes all subscriptions of the given connection
Parameters:
Name Type Description connectionStompServerConnection the connection - Source:
Returns:
the current instance of Destination- Type
- Destination