Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

ACK error check fires erroneously when more than one message is read.

  • Loading branch information...
commit 205c9572890905dd06003a19b6f775e545c0989a 1 parent df8c86b
Guy M. Allard authored

Showing 3 changed files with 9 additions and 19 deletions. Show diff stats Hide diff stats

  1. +3 6 ack_10/ack_10.go
  2. +3 7 ack_11/ack_11.go
  3. +3 6 ack_12/ack_12.go
9 ack_10/ack_10.go
@@ -78,6 +78,9 @@ func main() {
78 78 }
79 79 //
80 80 fmt.Printf("Frame Type: %s\n", m.Message.Command) // Will be MESSAGE or ERROR!
  81 + if m.Message.Command != stompngo.MESSAGE {
  82 + log.Fatalln(m) // Handle this ...
  83 + }
81 84 h := m.Message.Headers
82 85 for j := 0; j < len(h)-1; j += 2 {
83 86 fmt.Printf("Header: %s:%s\n", h[j], h[j+1])
@@ -90,12 +93,6 @@ func main() {
90 93 if e != nil {
91 94 log.Fatalln(e) // Handle this
92 95 }
93   - // Spurious ERROR frame?
94   - select {
95   - case m = <-r:
96   - log.Fatalln("RECEIVE not expected, got: [%v]\n", m)
97   - default:
98   - }
99 96 fmt.Println(exampid + "ACK complete ...")
100 97 }
101 98 // It is polite to unsubscribe, although unnecessary if a disconnect follows.
10 ack_11/ack_11.go
@@ -82,6 +82,9 @@ func main() {
82 82 }
83 83 //
84 84 fmt.Printf("Frame Type: %s\n", m.Message.Command) // Will be MESSAGE or ERROR!
  85 + if m.Message.Command != stompngo.MESSAGE {
  86 + log.Fatalln(m) // Handle this ...
  87 + }
85 88 h := m.Message.Headers
86 89 for j := 0; j < len(h)-1; j += 2 {
87 90 fmt.Printf("Header: %s:%s\n", h[j], h[j+1])
@@ -106,14 +109,7 @@ func main() {
106 109 if e != nil {
107 110 log.Fatalln(e) // Handle this
108 111 }
109   - // Spurious ERROR frame?
110   - select {
111   - case m = <-r:
112   - log.Fatalln("RECEIVE not expected, got: [%v]\n", m)
113   - default:
114   - }
115 112 fmt.Println(exampid + "ACK complete ...")
116   -
117 113 }
118 114 // It is polite to unsubscribe, although unnecessary if a disconnect follows.
119 115 // With Stomp 1.1, the same unique ID is required on UNSUBSCRIBE. Failure
9 ack_12/ack_12.go
@@ -82,6 +82,9 @@ func main() {
82 82 }
83 83 //
84 84 fmt.Printf("Frame Type: %s\n", m.Message.Command) // Will be MESSAGE or ERROR!
  85 + if m.Message.Command != stompngo.MESSAGE {
  86 + log.Fatalln(m) // Handle this ...
  87 + }
85 88 h := m.Message.Headers
86 89 for j := 0; j < len(h)-1; j += 2 {
87 90 fmt.Printf("Header: %s:%s\n", h[j], h[j+1])
@@ -106,12 +109,6 @@ func main() {
106 109 if e != nil {
107 110 log.Fatalln(e) // Handle this
108 111 }
109   - // Spurious ERROR frame?
110   - select {
111   - case m = <-r:
112   - log.Fatalln("RECEIVE not expected, got: [%v]\n", m)
113   - default:
114   - }
115 112 fmt.Println(exampid + "ACK complete ...")
116 113 }
117 114 // It is polite to unsubscribe, although unnecessary if a disconnect follows.

0 comments on commit 205c957

Please sign in to comment.
Something went wrong with that request. Please try again.