|
@@ -142,10 +142,10 @@ func (rb *ResponseBuffer) flushInternal(final bool, blocking bool) error {
|
142
|
142
|
}
|
143
|
143
|
|
144
|
144
|
useLabel := rb.target.capabilities.Has(caps.LabeledResponse) && rb.Label != ""
|
145
|
|
- // use a batch if we have a label, and we either currently have multiple messages,
|
|
145
|
+ // use a batch if we have a label, and we either currently have 0 or 2+ messages,
|
146
|
146
|
// or we are doing a Flush() and we have to assume that there will be more messages
|
147
|
147
|
// in the future.
|
148
|
|
- useBatch := useLabel && (len(rb.messages) > 1 || !final)
|
|
148
|
+ useBatch := useLabel && (len(rb.messages) != 1 || !final)
|
149
|
149
|
|
150
|
150
|
// if label but no batch, add label to first message
|
151
|
151
|
if useLabel && !useBatch && len(rb.messages) == 1 && rb.batchID == "" {
|