mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Route queue subscriber test
This commit is contained in:
@@ -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")
|
||||
}
|
||||
Reference in New Issue
Block a user