{"id":48704,"library":"ng2-stomp-service","title":"ng2-stomp-service","description":"STOMP Over WebSocket service for Angular 2. Stable version 1.2.2, last released in 2017. No active development or recent updates. Provides a simple service to connect to STOMP brokers over WebSocket (including SockJS) in Angular 2 applications. Key differentiator: built for Angular 2 dependency injection and integrates with RxJS Observables. Now largely superseded by newer libraries and Angular versions.","status":"abandoned","version":"1.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/devsullo/ng2-STOMP-Over-WebSocket","tags":["javascript","stomp","websockets","socket","sockjs","sockjs-client","angular2","angular 2","service"],"install":[{"cmd":"npm install ng2-stomp-service","lang":"bash","label":"npm"},{"cmd":"yarn add ng2-stomp-service","lang":"bash","label":"yarn"},{"cmd":"pnpm add ng2-stomp-service","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Angular 2.","package":"@angular/core","optional":false},{"reason":"Uses RxJS Observables for message streams.","package":"rxjs","optional":false},{"reason":"Optional: used when connecting via SockJS.","package":"sockjs-client","optional":true}],"imports":[{"note":"Named export; does not support default import.","wrong":"import * as StompService from 'ng2-stomp-service';","symbol":"StompService","correct":"import { StompService } from 'ng2-stomp-service';"},{"note":"Same import for both value and type.","symbol":"StompService (TypeScript type use)","correct":"import { StompService } from 'ng2-stomp-service';"},{"note":"CommonJS require of named export.","wrong":"const StompService = require('ng2-stomp-service');","symbol":"require (CommonJS)","correct":"const StompService = require('ng2-stomp-service').StompService;"}],"quickstart":{"code":"import { StompService } from 'ng2-stomp-service';\nimport { Injectable } from '@angular/core';\n\n@Injectable()\nexport class MyService {\n  constructor(private stomp: StompService) {}\n\n  connect() {\n    this.stomp.configure({\n      host: 'localhost',\n      port: 61614,\n      endpoint: '/ws',\n      login: process.env.STOMP_USER ?? '',\n      passcode: process.env.STOMP_PASS ?? '',\n      debug: true\n    });\n    this.stomp.startConnect().then(() => {\n      console.log('connected');\n      this.stomp.subscribe('/queue/test', (msg) => {\n        console.log(msg);\n      });\n    });\n  }\n\n  send() {\n    this.stomp.send('/queue/test', { data: 'hello' });\n  }\n}","lang":"typescript","description":"Angular service configuration and basic subscribe/send example."},"warnings":[{"fix":"Migrate to a maintained library like @stomp/stompjs or angular-stomp.","message":"Library is no longer maintained. It targets Angular 2 and may not work with Angular 4+.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Update to Angular compatible version or switch libraries.","message":"Uses Angular 2 lifecycle hooks; Angular 4+ changed module/component patterns.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use lettable operators (pipe) with RxJS 6+.","message":"Requires RxJS Observable; if using RxJS 6+, operators may need to be piped.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Manually unsubscribe in ngOnDestroy.","message":"SockJS sessions not automatically disconnected on page unload; may cause resource leaks.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.2':14 '2':11,40,47,74 '2017':18 'activ':20 'angular':10,39,46,62,73 'angular2':72 'applic':41 'broker':33 'built':44 'client':71 'connect':30 'depend':48 'develop':21 'differenti':43 'includ':36 'inject':49 'integr':51 'javascript':64 'key':42 'larg':56 'last':15 'librari':60 'newer':59 'ng2':2 'ng2-stomp-service':1 'observ':54 'provid':25 'recent':23 'releas':16 'rxjs':53 'servic':4,8,28,75 'simpl':27 'socket':67 'sockj':37,68,70 'sockjs-client':69 'stabl':12 'stomp':3,5,32,65 'supersed':57 'updat':24 'version':13,63 'websocket':7,35,66","created_at":"2026-06-07T16:58:02.379720+00:00","updated_at":"2026-06-07T16:58:02.379720+00:00","problems":[{"fix":"Update to RxJS 5 or use pipeable operators and adjust import.","cause":"Library imports patched RxJS operators; RxJS 6+ removed them.","error":"Error: Can't resolve 'rxjs/add/operator/map'"},{"fix":"Add StompService to providers array in NgModule.","cause":"StompService must be provided in a module or component.","error":"Error: No provider for StompService!"},{"fix":"Ensure import is correct, and configure before calling startConnect.","cause":"Incorrect import or stale library version.","error":"TypeError: this.stomp.startConnect is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/devsullo/ng2-STOMP-Over-WebSocket#readme","github":"https://github.com/devsullo/ng2-STOMP-Over-WebSocket","docs":null,"changelog":null,"pypi":null,"npm":"ng2-stomp-service","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}