cloudevents-player
cloudevents-player copied to clipboard
Can't send cloudevents to knative broker type of MTChannelBasedBroker
I deployed Knative v0.25.0 with Istio 1.11.2 gateway and network layer, and use kn to create service. I found error in istio-proxy log with status code 400, and in mt broker log, there is a warning on datacontenttype context attribute can't be parsed properly. And I read the code of the broker, with the warning, it'll return 400 and reject the event.
How to fix this?
What datacontenttype are you using? It only supports application/json
the player's default is application/json, isn't it?
I get the following attempting to send events.
| | 2022-05-13 23:03:40 | 2022-05-14 04:03:40,458 ERROR [com.red.sys.too.clo.ser.MessageService] (pool-9-thread-2) Unable to send cloudEvent: java.util.concurrent.CompletionException: javax.ws.rs.WebApplicationException: Unknown error, status code 500
| | 2022-05-13 23:03:40 | at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
| | 2022-05-13 23:03:40 | at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
| | 2022-05-13 23:03:40 | at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:932)
| | 2022-05-13 23:03:40 | at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
| | 2022-05-13 23:03:40 | at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
| | 2022-05-13 23:03:40 | at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
| | 2022-05-13 23:03:40 | at org.jboss.resteasy.microprofile.client.impl.MpClientInvocation$Decorator.lambda$decorate$0(MpClientInvocation.java:93)
| | 2022-05-13 23:03:40 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
| | 2022-05-13 23:03:40 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
| | 2022-05-13 23:03:40 | at java.lang.Thread.run(Thread.java:829)
| | 2022-05-13 23:03:40 | at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:553)
| | 2022-05-13 23:03:40 | at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
| | 2022-05-13 23:03:40 | Caused by: javax.ws.rs.WebApplicationException: Unknown error, status code 500
| | 2022-05-13 23:03:40 | at org.jboss.resteasy.microprofile.client.DefaultResponseExceptionMapper.toThrowable(DefaultResponseExceptionMapper.java:21)
| | 2022-05-13 23:03:40 | at org.jboss.resteasy.microprofile.client.ExceptionMapping$HandlerException.mapException(ExceptionMapping.java:39)
| | 2022-05-13 23:03:40 | at org.jboss.resteasy.microprofile.client.async.AsyncInterceptorRxInvoker.lambda$whenComplete$0(AsyncInterceptorRxInvoker.java:56)
| | 2022-05-13 23:03:40 | at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
| | 2022-05-13 23:03:40 | ... 9 more
Scratch all this. I am using the kafka broker and it seems ingress-broker
is hardcoded.
I'll take a look next week
@zacheryph I have tested myself and it might be you deployed the broker in a different namespace or the broker name is not default
I will work on more flexible configurations.
If you can't make it work please ping me on the knative slack channel
@snowwolf007cn did you fix the issue? I haven't been able to reproduce it.