Skip to content

Commit 4bcddda

Browse files
committed
move it to write message
Signed-off-by: Meng Yan <myan@redhat.com>
1 parent d06aea7 commit 4bcddda

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

protocol/mqtt_paho/v2/protocol.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ func (p *Protocol) Send(ctx context.Context, m binding.Message, transformers ...
9090
defer m.Finish(err)
9191

9292
msg := p.publishOption
93-
msg.Properties.User = make(paho.UserProperties, 0)
9493
if cecontext.TopicFrom(ctx) != "" {
9594
msg.Topic = cecontext.TopicFrom(ctx)
9695
cecontext.WithTopic(ctx, "")

protocol/mqtt_paho/v2/write_message.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ func (b *pubMessageWriter) SetStructuredEvent(ctx context.Context, f format.Form
5858

5959
func (b *pubMessageWriter) Start(ctx context.Context) error {
6060
if b.Properties == nil {
61-
b.Properties = &paho.PublishProperties{
62-
User: make([]paho.UserProperty, 0),
63-
}
61+
b.Properties = &paho.PublishProperties{}
6462
}
63+
// the UserProperties of publish message is used to load event extensions
64+
b.Properties.User = make([]paho.UserProperty, 0)
6565
return nil
6666
}
6767

0 commit comments

Comments
 (0)