Route queue subscriber test

This commit is contained in:
Derek Collison
2013-07-29 18:42:16 -07:00
parent c61412a862
commit 0adb1f443b

View File

@@ -231,3 +231,31 @@ func TestRouteOnlySendOnce(t *testing.T) {
matches := expectMsgs(1)
checkMsg(t, matches[0], "foo", "RSID:2:1", "", "2", "ok")
}
func TestRouteQueueSemantics(t *testing.T) {
s, opts := runRouteServer(t)
defer s.Shutdown()
client := createClientConn(t, opts.Host, opts.Port)
defer client.Close()
clientSend, _ := setupConn(t, client)
route := createRouteConn(t, opts.ClusterHost, opts.ClusterPort)
expectAuthRequired(t, route)
routeSend, routeExpect := setupRoute(t, route, opts)
expectMsgs := expectMsgsCommand(t, routeExpect)
// Express multiple interest on this route for foo, queue group bar.
routeSend("SUB foo bar RSID:2:1\r\n")
routeSend("SUB foo bar RSID:2:2\r\n")
// Normal Interest as well.
routeSend("SUB foo RSID:2:1\r\n")
// Send PUB via client connection
clientSend("PUB foo 2\r\nok\r\n")
matches := expectMsgs(1)
checkMsg(t, matches[0], "foo", "RSID:2:1", "", "2", "ok")
}