stompit | STOMP client library for node.js | Messaging library
kandi X-RAY | stompit Summary
kandi X-RAY | stompit Summary
A STOMP client library for Node.js that is fully compatible with STOMP 1.0, 1.1 and 1.2 servers. The library provides optional fault tolerance features such as multiple server failover and persistent subscriptions and message publishing across failure events. The API is designed to be consistent with idiomatic Node.js code. Messages are stream oriented. The client supports any stream.Duplex transport, such as for example tls.TLSSocket.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Connects to a remote socket .
- Returns the address info part of the given args
- Normalize event args
- Called when a connection is received .
- Parse a URI .
- Service to process the stream .
- Parses the given uri url .
- Listen for incoming connection
- called when we re done
- Webpack error handler
stompit Key Features
stompit Examples and Code Snippets
Community Discussions
Trending Discussions on stompit
QUESTION
Currently I am using stomp protocol to send messages to activeMQ and to listen to messages. This is done in Nodejs using stompit library.
When the application is having high CPU or Memory usage, it stops sending heartbeat to broker. So the broker redelivers the message which is currently being processed, leading to repetitive processing of the same message
On disabling heartbeat, the application seems to work fine but I am unsure of the further issues disabling heartbeat might cause. Even when the broker is stopped while sending messages, behaviour seems to be same with or without heartbeat
I have read that it is an optional parameter but I am unable to find out it's exact use cases
Can anyone mention scenarios where no heart beat can cause issues to the application?
...ANSWER
Answered 2021-Jun-03 at 15:07Regarding the purpose of heart-beating the STOMP 1.2 specification just says:
Heart-beating can optionally be used to test the healthiness of the underlying TCP connection and to make sure that the remote end is alive and kicking.
Heart-beats potentially flow both from the client to the server and from the server to the client so the "remote end" referenced in the spec here could be the client or the server.
For the server, heart-beating is useful to ensure that server-side resources are cleaned up in a timely manner to avoid excessive strain. Server-side resources are maintained for all client connections and it helps the broker to be able to detect quickly when those connections fail (i.e. heart-beats aren't received) so it can clean up those resources. If heart-beating is disabled then it's possible that a dead connection would not be detected and the server would have to maintain its resources for that dead connection in vain.
For a client, heart-beating is useful to avoid message loss when performing asynchronous sends. Messages are often sent asynchronously by clients (i.e. fire and forget). If there was no mechanism to detect connection loss the client could continue sending messages async on a dead connection. Those messages would be lost since they would never reach the broker. Heart-beating mitigates this situation.
QUESTION
We are using ActiveMQ 5.16.1 with the stompit client to create a durable subscription in our NodeJS app using the following code snippet:
...ANSWER
Answered 2021-May-12 at 01:46You first need to disconnect the connection which the durable subscriber is using. This deactivates the subscription and will prevent the JMSException: Durable consumer is in use
you're seeing.
Then you need to reconnect using the same client-id
header value which you used on your CONNECT
frame for the connection used to subscribe.
Then need to pass the activemq.subscriptionName
header in the UNSUBSCRIBE
frame just like you did for the SUBSCRIBE
frame, e.g.:
QUESTION
I have an application which sends messages to a queue, and another application which subscribes to the queue and process it. I want OTP messages to be given higher priority than other messages, hence I am trying to use ActiveMQ message priority to achieve this.
This is the code for ActiveMQ connection using STOMP protocol in nodejs using stompit library:
...ANSWER
Answered 2021-Mar-21 at 03:46Support for priority is disabled by default in ActiveMQ "Classic" (used by Amazon MQ). As the documentation states:
...support [for message priority] is disabled by default so it needs to be be enabled using per destination policies through xml configuration...
You need to set prioritizedMessages="true"
in the policyEntry
for your queue, e.g.:
QUESTION
I am making stompit connection to my ActiveMQ Artemis broker and I see no error when calling connect. After some time (in few mins) I see Connection timeout error.
Also, I am not seeing the queue being created (only address) getting created and the message is not seen at the Artemis console.
ActiveMQ Artemis console:
Code:
...ANSWER
Answered 2020-Jan-30 at 19:51The ActiveMQ Artemis STOMP documentation should be helpful here.
The first thing I recommend is enabling debug logging. The documentation states:
Incoming and outgoing STOMP frames can be logged by enabling
DEBUG
fororg.apache.activemq.artemis.core.protocol.stomp.StompConnection
. This can be extremely useful for debugging or simply monitoring client activity. Along with the STOMP frame itself the remote IP address of the client is logged as well as the internal connection ID so that frames from the same client can be correlated.
You can enable this logging by modifying etc/logging.properties
.
First, add this to the comma-separated loggers
list at the beginning of the file:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install stompit
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page