rocketmq-clients icon indicating copy to clipboard operation
rocketmq-clients copied to clipboard

[Bug] NET8.0环境下无法启动成功

Open danny-adu opened this issue 4 months ago • 0 comments

Before Creating the Bug Report

  • [X] I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • [X] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Programming Language of the Client

C#

Runtime Platform Environment

win10

RocketMQ Version of the Client/Server

version: '3.5' services: namesrv: image: apache/rocketmq:latest container_name: rmqnamesrv ports: - "9876:9876" command: sh mqnamesrv networks: - rocketmq_net

broker: image: apache/rocketmq:latest container_name: rmqbroker ports: - "10909:10909" - "10911:10911" environment: - NAMESRV_ADDR=rmqnamesrv:9876 command: sh mqbroker -n rmqnamesrv:9876 -c ../conf/broker.conf # 修改为 rmqnamesrv:9876 depends_on: - namesrv networks: - rocketmq_net

console: image: styletang/rocketmq-console-ng container_name: rmqconsole ports: - "8080:8080" environment: - JAVA_OPTS=-Drocketmq.namesrv.addr=rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false depends_on: - namesrv networks: - rocketmq_net

networks: rocketmq_net: driver: bridge

Run or Compiler Version

vs2022

Describe the Bug

Grpc.Core.RpcException:“Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: An HTTP/2 connection could not be established because the server did not complete the HTTP/2 handshake. (InvalidResponse) HttpIOException: An HTTP/2 connection could not be established because the server did not complete the HTTP/2 handshake. (InvalidResponse) HttpIOException: The response ended prematurely while waiting for the next frame from the server. (ResponseEnded)", DebugException="System.Net.Http.HttpRequestException: An HTTP/2 connection could not be established because the server did not complete the HTTP/2 handshake. (InvalidResponse)")”

Steps to Reproduce

[TestMethod] [ExpectedException(typeof(InvalidOperationException))] public void TestSendBeforeStartup() { var clientConfig = new ClientConfig.Builder().SetEndpoints("127.0.0.1:9876").EnableSsl(false).Build();

AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);

var producer = new Producer.Builder()
    // Set the topic name(s), which is optional but recommended.
    // It makes producer could prefetch the topic route before message publishing.
    .SetTopics("testTopic")
    .SetClientConfig(clientConfig)
    .Build().ConfigureAwait(false).GetAwaiter().GetResult();

var message = new Message.Builder().SetTopic("testTopic").SetBody(Encoding.UTF8.GetBytes("foobar")).Build();
var result = producer.Send(message).ConfigureAwait(false).GetAwaiter().GetResult();

Assert.IsTrue(result.MessageId != null);

}

What Did You Expect to See?

我把NET6.0框架去掉,只用NET8.0,无法使用

What Did You See Instead?

生产者无法把数据推送给rocketmq

Additional Context

No response

danny-adu avatar Oct 03 '24 10:10 danny-adu