Giter VIP home page Giter VIP logo

node-stomp's Introduction

node-stomp

Overview

A simple STOMP client.

Usage

Subscribing

Basic

var sys = require("sys"),
  stomp = require("./stomp");

var client = new stomp.Client("localhost", 61613);
client.subscribe("/queue/news", function(data){
  sys.puts(data.body);
});

ACK

var sys = require("sys"),
  stomp = require("./stomp");

var client = new stomp.Client("localhost", 61613);
client.subscribe("/queue/news", {ack: "client"}, function(data){
  sys.puts(data.body);
  client.ack(data);
});

Publishing

var stomp = require("./stomp");

var client = new stomp.Client("localhost", 61613);
client.publish("/queue/news", "Stomp for NodeJS!");

TODO

  • make durable
  • add SSL support

License

MIT License

node-stomp's People

Contributors

cdwiegand avatar kates avatar magicmonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-stomp's Issues

Very slow on subscribe

Hi,

I trying to use this library with jBoss HornetQ 2.1.2 final with STOMP connector.
In test script, i have more them 9000 msg/sec to publish (900 byte string, random JSON object),
but only 20 - 50 msg/sec to subscribe (!) its very slow...what? Server is small EC2 instance without any other system loading. Node is 0.2.

Receiving partial frames

I will fairly frequently receive only partial frames (headers are in-tact, body is not) that obviously causes issues when deserializing the body.

   debug - websocket writing 5:::{"name":"HealthVmf","args":[{"content":{"software_version":"1","event_time":"2011-11-18T11:11:14","usmc_reg_number":"750007","reporting_rules":{},"niin":"","asset_predictions":[{"confidence":0.11886785150782209,"type":"health","prediction_value":24,"value":0.8690623483033539,"units_of_measure":"hours"},{"confidence":0.004299265411375486,"type":"health","prediction_value":48,"value":0.06361559861095223,"units_of_measure":"hours"},{"confidence":0.11785012912386283,"type":"health","prediction_value":72,"value":0.3375146161848036,"units_of_measure":"hours"},{"confidence":0.9456682047928826,"type":"capability","prediction_value":24,"value":0.16703802851403682,"units_of_measure":"hours"},{"confidence":0.06421372021030214,"type":"capability","prediction_value":48,"value":0.7132979341161454,"units_of_measure":"hours"},{"confidence":0.7637086198212889,"type":"capability","prediction_value":72,"value":0.24131532630889097,"units_of_measure":"hours"}],"subsystem_predictions":[],"null":"4ec683ac6b3d64131000004a","longitude":-91.98810313762532,"asset_ratings":[{"confidence":0.37463542561153107,"type":"health","value":0.14276005105890377},{"confidence":0.7280031347834909,"type":"status","value":0.5775468815260397},{"confidence":0.9904095475559633,"type":"capability","value":0.9380546816751684}],"iuid":"750007","latitude":61.10325997007084,"subsystem_ratings":[],"urn":"1","reporting_interval_minutes":54,"free_text":""}}]}
Error deserializing incoming data: SyntaxError: Unexpected token ILLEGAL
Original message: MESSAGE
message-id:ID:phm-dst-53194-1321478973416-2:174:-1:1:26
destination:/queue/websocket
timestamp:1321632678492
expires:0
priority:4

{"content": {"software_vers

   debug - websocket writing 5:::{"name":"HealthVmf","args":[{"content":{"software_version":"1","event_time":"2011-11-18T11:11:14","usmc_reg_number":"460120","reporting_rules":{},"niin":"","asset_predictions":[{"confidence":0.14583134511781315,"type":"health","prediction_value":24,"value":0.8374303824883288,"units_of_measure":"hours"},{"confidence":0.2235537688241921,"type":"health","prediction_value":48,"value":0.9900469231042737,"units_of_measure":"hours"},{"confidence":0.8385740996737078,"type":"health","prediction_value":72,"value":0.7004248233157432,"units_of_measure":"hours"},{"confidence":0.5594018113384451,"type":"capability","prediction_value":24,"value":0.6876143514882849,"units_of_measure":"hours"},{"confidence":0.8870432943790096,"type":"capability","prediction_value":48,"value":0.44314667511221295,"units_of_measure":"hours"},{"confidence":0.3371514399311314,"type":"capability","prediction_value":72,"value":0.4646472118803988,"units_of_measure":"hours"}],"subsystem_predictions":[],"null":"4ec683a46b3d64131000003e","longitude":99.44465273223716,"asset_ratings":[{"confidence":0.5969260411835807,"type":"health","value":0.38639053600759976},{"confidence":0.37693504788594645,"type":"status","value":0.8551969563563105},{"confidence":0.36904633564017475,"type":"capability","value":0.5075242386313786}],"iuid":"460120","latitude":83.47859480455003,"subsystem_ratings":[],"urn":"1","reporting_interval_minutes":17,"free_text":""}}]}

I have verified that the original data being published is a complete frame, so I'm suspecting there's just something strange going on with the node-stomp library. Are there speed limitations that I'm exceeding?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.