Apaq / StompDart

A Stomp implementation for Dart heavily inspired by StompJS
Apache License 2.0
8 stars 4 forks source link

Unable to make SocketAdapter works with RabbitMQ #11

Closed sdeleuze closed 9 years ago

sdeleuze commented 9 years ago

Hi,

I try to use SocketAdapter to connect to my RabbitMQ STOMP broker.

My code:

Socket.connect('127.0.0.1', 61613).then((socket) {
      Stomp.SocketAdapter adapter = new SocketAdapter(socket);
      _stomClient = new Stomp.Client(adapter);
      _stomClient.connect(login: 'guest', passcode: 'guest').then((frame) => 
            _stomClient.subscribe('/topic/test').listen((frame) => print(frame.body)));
});

but I got the following error:

Unhandled exception:
Uncaught Error: type 'Uint8List' is not a subtype of type 'String' of 'data'.
Stack Trace:
#0      Client.connect.<anonymous closure> (package:stompdart/stomp.dart:183:22)
#1      _RootZone.runUnaryGuarded (dart:async/zone.dart:1020)
#2      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)

I have even try to add support for Uint8List in my fork (https://github.com/sdeleuze/StompDart/commit/c113e1beeb25470689c3a11bf22de38f7844cf2f) but this is no the right thing to do since frame parsing fail.

Could you help me to make it work ?

sdeleuze commented 9 years ago

I have found a fix that works, could you review and hopefully merge this pull request to master and publish stompdart 0.2.2 to pub ?

michaelkrog commented 9 years ago

Yep. I'm a bit busy today. I'll take a look later.

Thank for submitting your PR.

michaelkrog commented 9 years ago

Fixed by https://github.com/Apaq/StompDart/pull/12