apache / apache/eventmesh

[Bug] In the SDK-Java HTTP subscription method, it is unable to subscribe to events from the HttpConnector Source.

Open
#5,248 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1.8k
Forks
658
Avg merge
11h 29m
Merged PRs (30d)
52

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.

### Environment

Linux

### EventMesh version

master

### What happened

tag v1.12.0:

In the SDK-Java HTTP subscription method, it is unable to subscribe to events from the HttpConnector Source.

### How to reproduce

The source of the httpconnector in Eventmesh provides an HTTP interface to receive the data, and then writes it to Eventmesh. I used http in SDK-java to subscribe, but it got an error.

cloudevent to HttpEventWrapper occur except, group:CC, topic:table6a, bizSeqNo=c8cdbe62-5f7f-4484-b562-23ee1b28aa54, uniqueId=c8cdbe62-5f7f-4484-b562-23ee1b28aa54
java.lang.ClassCastException: org.apache.eventmesh.common.protocol.tcp.Package cannot be cast to org.apache.eventmesh.common.protocol.http.HttpEventWrapper
at org.apache.eventmesh.runtime.core.protocol.http.push.AsyncHTTPPushRequest.tryHTTPRequest(AsyncHTTPPushRequest.java:169) ~[eventmesh-runtime-1.11.0-release.jar:1.11.0-release]
at org.apache.eventmesh.runtime.core.protocol.http.push.HTTPMessageHandler.lambda$handle$2(HTTPMessageHandler.java:92) ~[eventmesh-runtime-1.11.0-release.jar:1.11.0-release]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_162]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_162]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
2026-05-06 09:54:11,167 WARN [eventMesh-pushMsg-2] AsyncHTTPPushRequest(AsyncHTTPPushRequest.java:179) - cloudevent to HttpEventWrapper occur except, group:TT, topic:table6a, bizSeqNo=49df2557-ddef-4641-a06a-9901ea15e645, uniqueId=49df2557-ddef-4641-a06a-9901ea15e645
java.lang.ClassCastException: org.apache.eventmesh.common.protocol.tcp.Package cannot be cast to org.apache.eventmesh.common.protocol.http.HttpEventWrapper
at org.apache.eventmesh.runtime.core.protocol.http.push.AsyncHTTPPushRequest.tryHTTPRequest(AsyncHTTPPushRequest.java:169) ~[eventmesh-runtime-1.11.0-release.jar:1.11.0-release]
at org.apache.eventmesh.runtime.core.protocol.http.push.HTTPMessageHandler.lambda$handle$2(HTTPMessageHandler.java:92) ~[eventmesh-runtime-1.11.0-release.jar:1.11.0-release]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_162]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_162]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
2026-05-06 09:54:11,167 WARN [eventMesh-pushMsg-2] AsyncHTTPPushRequest(AsyncHTTPPushRequest.java:179) - cloudevent to HttpEventWrapper occur except, group:CC, topic:table6a, bizSeqNo=49df2557-ddef-4641-a06a-9901ea15e645, uniqueId=49df2557-ddef-4641-a06a-9901ea15e645
java.lang.ClassCastException: org.apache.eventmesh.common.protocol.tcp.Package cannot be cast to org.apache.eventmesh.common.protocol.http.HttpEventWrapper
at org.apache.eventmesh.runtime.core.protocol.http.push.AsyncHTTPPushRequest.tryHTTPRequest(AsyncHTTPPushRequest.java:169) ~[eventmesh-runtime-1.11.0-release.jar:1.11.0-release]
at org.apache.eventmesh.runtime.core.protocol.http.push.HTTPMessageHandler.lambda$handle$2(HTTPMessageHandler.java:92) ~[eventmesh-runtime-1.11.0-release.jar:1.11.0-release]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_162]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_162]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]

### Debug logs

```Java

```

### Are you willing to submit PR?

- [x] Yes I am willing to submit a PR!

### Code of Conduct

- [ ] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) *

Contributor guide

Open the contributing guide

Research direction

Start with AsyncHTTPPushRequest.java at line 169 and HTTPMessageHandler.java at line 92, where the reported ClassCastException occurs. Reproduce an SDK-Java HTTP subscription against an HttpConnector source and trace the received Package value. Done means the subscription accepts the source events without the cast exception and delivers them successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.