{"action":"reopened","issue":{"url":"https://api.github.com/repos/nats-io/nats/issues/222","repository_url":"https://api.github.com/repos/nats-io/nats","labels_url":"https://api.github.com/repos/nats-io/nats/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/nats-io/nats/issues/222/comments","events_url":"https://api.github.com/repos/nats-io/nats/issues/222/events","html_url":"https://github.com/nats-io/nats/issues/222","id":177291086,"number":222,"title":"Are there any tricks to get BindRecvQueueChan to work with wildcard subscription?","user":{"login":"vpol","id":203558,"avatar_url":"https://avatars.githubusercontent.com/u/203558?v=3","gravatar_id":"","url":"https://api.github.com/users/vpol","html_url":"https://github.com/vpol","followers_url":"https://api.github.com/users/vpol/followers","following_url":"https://api.github.com/users/vpol/following{/other_user}","gists_url":"https://api.github.com/users/vpol/gists{/gist_id}","starred_url":"https://api.github.com/users/vpol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpol/subscriptions","organizations_url":"https://api.github.com/users/vpol/orgs","repos_url":"https://api.github.com/users/vpol/repos","events_url":"https://api.github.com/users/vpol/events{/privacy}","received_events_url":"https://api.github.com/users/vpol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-15T21:11:13Z","updated_at":"2016-09-15T21:36:03Z","closed_at":null,"body":"```\r\npackage main\r\n\r\nimport (\r\n\tlog \"github.com/Sirupsen/logrus\"\r\n\t\"github.com/nats-io/nats\"\r\n\t\"time\"\r\n)\r\n\r\nfunc main() {\r\n\r\n\tlog.SetLevel(log.DebugLevel)\r\n\r\n\tclient, err := nats.Connect(\"nats://127.0.0.1:4222\")\r\n\tif err != nil {\r\n\t\tlog.Panic(err)\r\n\t}\r\n\r\n\tconn, err := nats.NewEncodedConn(client, nats.JSON_ENCODER)\r\n\tif err != nil {\r\n\t\tlog.Panic(err)\r\n\t}\r\n\r\n\tconn.Subscribe(\"wc1:test:response\", func(m *nats.Msg) {\r\n\t\tlog.Debugf(\"hello from wc1\")\r\n\t})\r\n\r\n\tconn.Subscribe(\"wc2:test:response\", func(m *nats.Msg) {\r\n\t\tlog.Debugf(\"hello from wc2\")\r\n\t})\r\n\r\n\tgo func() {\r\n\t\tin := make(chan interface{})\r\n\t\t_, err = conn.BindRecvQueueChan(\"wc1:*:request\", \"wc1\", in)\r\n\t\tif err != nil {\r\n\t\t\tlog.Panic(err)\r\n\t\t}\r\n\t\tfor {\r\n\t\t\tselect {\r\n\t\t\tcase <-in:\r\n\t\t\t\tout := make(chan interface{})\r\n\t\t\t\tconn.BindSendChan(\"wc1:test:response\", out)\r\n\t\t\t\tout <- nats.Msg{Data: []byte{}}\r\n\t\t\t}\r\n\t\t}\r\n\t}()\r\n\r\n\tgo func() {\r\n\t\tin := make(chan interface{})\r\n\t\t_, err = conn.BindRecvQueueChan(\"wc2:test:request\", \"wc2\", in)\r\n\t\tif err != nil {\r\n\t\t\tlog.Panic(err)\r\n\t\t}\r\n\t\tfor {\r\n\t\t\tselect {\r\n\t\t\tcase <-in:\r\n\t\t\t\tout := make(chan interface{})\r\n\t\t\t\tconn.BindSendChan(\"wc2:test:response\", out)\r\n\t\t\t\tout <- nats.Msg{Data: []byte{}}\r\n\t\t\t}\r\n\t\t}\r\n\t}()\r\n\r\n\tgo func() {\r\n\t\tticker := time.NewTicker(1 * time.Second)\r\n\t\tfor {\r\n\t\t\tselect {\r\n\t\t\tcase <-ticker.C:\r\n\t\t\t\tconn.Publish(\"wc1:test:request\", nats.Msg{})\r\n\t\t\t\tconn.Publish(\"wc2:test:request\", nats.Msg{})\r\n\t\t\t}\r\n\t\t}\r\n\t}()\r\n\r\n\tselect {}\r\n}\r\n```\r\n```\r\n$ go build && ./main\r\nDEBU[0001] hello from wc2\r\nDEBU[0002] hello from wc2\r\nDEBU[0003] hello from wc2\r\nDEBU[0004] hello from wc2\r\nDEBU[0005] hello from wc2\r\nDEBU[0006] hello from wc2\r\nDEBU[0007] hello from wc2\r\nDEBU[0008] hello from wc2\r\nDEBU[0009] hello from wc2\r\nDEBU[0010] hello from wc2\r\nDEBU[0011] hello from wc2\r\nDEBU[0012] hello from wc2\r\nDEBU[0013] hello from wc2\r\nDEBU[0014] hello from wc2\r\n```"}}
{"actor":{"display_login":"vpol"}}