Dart and RabbitMQ bind exchange -
i use stomp package, , wrote test:
test('can subscribe , send events mq server', () async { stompclient client2 = await serverclient.connect(mqip, port: mqport, login: login, passcode: password); client2.sendjson('domain changed', {'a':'b'}); client2.disconnect(); streamcontroller controller = new streamcontroller(); stream<string> stream = controller.stream.asbroadcaststream(); stompclient client1 = await serverclient.connect(mqip, port: mqport, login: login, passcode: password); client1.subscribestring("entity changed", 'domain changed', (map<string, string> headers, string message) { controller.add(message); }, ack: auto); await (string message in stream) { string expectedentity = '{\"a\":\"b\"}'; expect(message, equals(expectedentity)); break; } client1.unsubscribe("entity changed"); client1.disconnect(); }, timeout: new timeout(new duration(seconds: 6)));
when run pub run test
test timed out
.
in rabbitmq managment in bindings section get: (default exchange binding)
, 0 in total messages:
is possible send , recive messages in 1 channel?
if use client1.subscribestring(ack: client,...)
in rabbitmq managment 1 message "in memory" test still test timed out
, can't message mq.
maybe must set amq.fanout exchange, how can this?
best choice use rabbitmq dart: mqtt package
Comments
Post a Comment