Skip to content

Commit

Permalink
move it to write message
Browse files Browse the repository at this point in the history
Signed-off-by: Meng Yan <myan@redhat.com>
  • Loading branch information
yanmxa committed Sep 13, 2023
1 parent d06aea7 commit 4bcddda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion protocol/mqtt_paho/v2/protocol.go
Expand Up @@ -90,7 +90,6 @@ func (p *Protocol) Send(ctx context.Context, m binding.Message, transformers ...
defer m.Finish(err)

msg := p.publishOption
msg.Properties.User = make(paho.UserProperties, 0)
if cecontext.TopicFrom(ctx) != "" {
msg.Topic = cecontext.TopicFrom(ctx)
cecontext.WithTopic(ctx, "")
Expand Down
6 changes: 3 additions & 3 deletions protocol/mqtt_paho/v2/write_message.go
Expand Up @@ -58,10 +58,10 @@ func (b *pubMessageWriter) SetStructuredEvent(ctx context.Context, f format.Form

func (b *pubMessageWriter) Start(ctx context.Context) error {
if b.Properties == nil {
b.Properties = &paho.PublishProperties{
User: make([]paho.UserProperty, 0),
}
b.Properties = &paho.PublishProperties{}
}
// the UserProperties of publish message is used to load event extensions
b.Properties.User = make([]paho.UserProperty, 0)
return nil
}

Expand Down

0 comments on commit 4bcddda

Please sign in to comment.