You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "richzhu369 (via GitHub)" <gi...@apache.org> on 2024/05/29 09:29:34 UTC

[I] can not CreateTopic [rocketmq-client-go]

richzhu369 opened a new issue, #1143:
URL: https://github.com/apache/rocketmq-client-go/issues/1143

   can not create topic when i use rocketmq-client-go v2
   
   ```go
   import (
   	"context"
   	"fmt"
   	"github.com/apache/rocketmq-client-go/v2/admin"
   	"github.com/apache/rocketmq-client-go/v2/primitive"
   	"github.com/gin-gonic/gin"
   	"log"
   	"net/http"
   	"strings"
   )
   
   func CreateTopic(c *gin.Context) {
   	endPoint := []string{"18.163.92.55:9876"}
   	topicName := "RichTestTopic"
   	// 创建主题
   	// 先连接远程的服务器,得到一个具柄testAdmin,然后利用该具柄创建CreateTopic()创建topic
   	testAdmin, err := admin.NewAdmin(admin.WithResolver(primitive.NewPassthroughResolver(endPoint)))
   	// 检查是否连接成功
   	if err != nil {
   		fmt.Printf("connection error: %s\n", err.Error())
   	}
   	err = testAdmin.CreateTopic(context.Background(),
   		admin.WithTopicCreate(topicName))
   	// 检查是否创建topic失败
   	if err != nil {
   		fmt.Printf("createTopic error: %s\n", err.Error())
   	}
   }
   ```
   
   always show error:
   ```text
   ERRO[0001] create topic error                            broker= topic=RichTestTopic underlayError="dial tcp: missing address"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] can not CreateTopic [rocketmq-client-go]

Posted by "richzhu369 (via GitHub)" <gi...@apache.org>.
richzhu369 commented on issue #1143:
URL: https://github.com/apache/rocketmq-client-go/issues/1143#issuecomment-2137170989

   my code problem


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] can not CreateTopic [rocketmq-client-go]

Posted by "richzhu369 (via GitHub)" <gi...@apache.org>.
richzhu369 closed issue #1143: can not CreateTopic
URL: https://github.com/apache/rocketmq-client-go/issues/1143


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org