@@ -155,7 +155,8 @@ var NewProducer = func(config *Config, opts ...ProducerOption) (Producer, error)
155155 }
156156 for _ , topic := range po .topics {
157157 topicResource := & v2.Resource {
158- Name : topic ,
158+ Name : topic ,
159+ ResourceNamespace : config .NameSpace ,
159160 }
160161 p .pSetting .topics .Store (topic , topicResource )
161162 }
@@ -287,7 +288,7 @@ func (p *defaultProducer) send0(ctx context.Context, msgs []*UnifiedMessage, txE
287288 var err error
288289 pubMessage = uMsg .pubMsg
289290 if uMsg .pubMsg == nil {
290- pubMessage , err = NewPublishingMessage (msg , p .pSetting , txEnabled )
291+ pubMessage , err = NewPublishingMessage (msg , p .cli . config . NameSpace , p . pSetting , txEnabled )
291292 if err != nil {
292293 return nil , err
293294 }
@@ -315,7 +316,8 @@ func (p *defaultProducer) send0(ctx context.Context, msgs []*UnifiedMessage, txE
315316 }
316317 if _ , ok := p .pSetting .topics .Load (topicName ); ! ok {
317318 p .pSetting .topics .Store (topicName , & v2.Resource {
318- Name : topicName ,
319+ Name : topicName ,
320+ ResourceNamespace : p .cli .config .NameSpace ,
319321 })
320322 }
321323 pubLoadBalancer , err := p .getPublishingTopicRouteResult (ctx , topicName )
@@ -362,7 +364,7 @@ func (p *defaultProducer) SendWithTransaction(ctx context.Context, msg *Message,
362364 return nil , fmt .Errorf ("producer is not running" )
363365 }
364366 t := transaction .(* transactionImpl )
365- pubMessage , err := t .tryAddMessage (msg )
367+ pubMessage , err := t .tryAddMessage (msg , p . cli . config . NameSpace )
366368 if err != nil {
367369 return nil , err
368370 }
@@ -394,7 +396,8 @@ func (p *defaultProducer) endTransaction(ctx context.Context, endpoints *v2.Endp
394396 ctx = p .cli .Sign (ctx )
395397 request := & v2.EndTransactionRequest {
396398 Topic : & v2.Resource {
397- Name : messageCommon .topic ,
399+ Name : messageCommon .topic ,
400+ ResourceNamespace : p .cli .config .NameSpace ,
398401 },
399402 MessageId : messageId ,
400403 TransactionId : transactionId ,
0 commit comments