You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class HTTP {
public static void main(String[] args) throws Exception {
EventMeshHttpClientConfig eventMeshClientConfig = EventMeshHttpClientConfig.builder()
.liteEventMeshAddr("192.168.1.4:10105")
.producerGroup("TEST_PRODUCER_GROUP")
.env("DEV")
.idc("idc")
.ip(IPUtils.getLocalAddress())
.sys("1234")
.pid(String.valueOf(ThreadUtils.getPID()))
.userName("eventmesh")
.password("password")
.build();
EventMeshHttpProducer eventMeshHttpProducer = new EventMeshHttpProducer(eventMeshClientConfig);
Map<String, String> content = new HashMap<>();
content.put("content", "testAsyncMessage----------------------");
CloudEvent event = CloudEventBuilder.v1()
.withId(UUID.randomUUID().toString())
.withSubject("eventmesh-async-topic")
.withSource(URI.create("/"))
.withDataContentType("application/cloudevents+json")
.withType(EventMeshCommon.CLOUD_EVENTS_PROTOCOL_NAME)
.withData(JsonUtils.toJSONString(content).getBytes(StandardCharsets.UTF_8))
.withExtension(Constants.EVENTMESH_MESSAGE_CONST_TTL, String.valueOf(4 * 1000))
.build();
for(int i = 0; i < 10; ++i){
eventMeshHttpProducer.publish(event);
}
}
}
Debug logs
client exception
2023-03-16 22:59:54,851 DEBUG [main] HttpUtils(HttpUtils.java:112) - POST http://192.168.1.4:10105 HTTP/1.1
Exception in thread "main" org.apache.eventmesh.common.exception.EventMeshException: Publish message error, target:http://192.168.1.4:10105
at org.apache.eventmesh.client.http.AbstractProducerHttpClient.publish(AbstractProducerHttpClient.java:56)
at org.apache.eventmesh.client.http.producer.EventMeshHttpProducer.publish(EventMeshHttpProducer.java:47)
at org.example.objectsize.HTTP.main(HTTP.java:48)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.base/java.net.SocketInputStream.socketRead0(Native Method)
at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:221)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140)
at org.apache.eventmesh.client.http.util.HttpUtils.post(HttpUtils.java:115)
at org.apache.eventmesh.client.http.util.HttpUtils.post(HttpUtils.java:65)
at org.apache.eventmesh.client.http.util.HttpUtils.post(HttpUtils.java:57)
at org.apache.eventmesh.client.http.AbstractProducerHttpClient.publish(AbstractProducerHttpClient.java:50)
... 2 more
2023-03-16 23:00:09,885 pool-1-thread-1 DEBUG Stopping LoggerContext[name=2437c6dc, org.apache.logging.log4j.core.LoggerContext@a202ccb]
2023-03-16 23:00:09,886 pool-1-thread-1 DEBUG Stopping LoggerContext[name=2437c6dc, org.apache.logging.log4j.core.LoggerContext@a202ccb]...
2023-03-16 23:00:09,888 pool-1-thread-1 DEBUG Shutting down OutputStreamManager SYSTEM_OUT.false.false
2023-03-16 23:00:09,888 pool-1-thread-1 DEBUG OutputStream closed
2023-03-16 23:00:09,888 pool-1-thread-1 DEBUG Shut down OutputStreamManager SYSTEM_OUT.false.false, all resources released: true
2023-03-16 23:00:09,889 pool-1-thread-1 DEBUG Appender console stopped with status true
2023-03-16 23:00:09,889 pool-1-thread-1 DEBUG Log4j2 ConfigurationScheduler shutting down threads in java.util.concurrent.ScheduledThreadPoolExecutor@1e78a3f9[Running, pool size = 1, active threads = 0, queued tasks = 1, completed tasks = 0]
2023-03-16 23:00:09,889 pool-1-thread-1 DEBUG Stopped XmlConfiguration[location=jar:file:/E:/develop/mavenRepository/org/apache/eventmesh/eventmesh-sdk-java/1.8.1-SNAPSHOT/eventmesh-sdk-java-1.8.1-SNAPSHOT.jar!/log4j2.xml] OK
2023-03-16 23:00:09,889 pool-1-thread-1 DEBUG Stopped LoggerContext[name=2437c6dc, org.apache.logging.log4j.core.LoggerContext@a202ccb] with status true
Search before asking
Environment
Windows
EventMesh version
master
What happened
When I use EventMeshHttpProducer to publish message. throw java.net.SocketTimeoutException: Read timed out
How to reproduce
public class HTTP {
public static void main(String[] args) throws Exception {
EventMeshHttpClientConfig eventMeshClientConfig = EventMeshHttpClientConfig.builder()
.liteEventMeshAddr("192.168.1.4:10105")
.producerGroup("TEST_PRODUCER_GROUP")
.env("DEV")
.idc("idc")
.ip(IPUtils.getLocalAddress())
.sys("1234")
.pid(String.valueOf(ThreadUtils.getPID()))
.userName("eventmesh")
.password("password")
.build();
}
Debug logs
client exception
runtime exception
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: