This message was deleted.
# general
s
This message was deleted.
y
the endpoint doesn’t look right. there should be api version and kind (admin).
do you have swagger.json imported to check the api endpoints?
d
It depends on whether the brokerURL is publicly accessible or not. If it is a K8s internal IP address, then you might want to consider port-forwarding or try running the command inside one of the pods
o
it's public and I can do all other operation
@Yu Wei Sung I don't have swagger imported
@David K the proxy api is what is accessible, I can perform every other operation excellently just this one I can not
d
Which API are you using? Admin? Or are you trying to publish via HTTP? As YuWei mentioned, for the Admin API, you need to include a version number, etc.
o
hello @David K sir, this is my request
Copy code
curl --location '<http://localhost:8080/topics/persistent/public/default/my-topic>' \
--header 'Content-Type: application/json' \
--data '{
    "messages": [
    {
      "key":"my-key",
      "payload":"test ", 
      "eventTime":1603045262772,
      "sequenceId":1 
    }
    
  ]
}'
this runs well on my local machine but when I try this using my k8 proxy service url I get a 404 output
Copy code
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
	<title>Error 404 Not Found</title>
</head>

<body>
	<h2>HTTP ERROR 404 Not Found</h2>
	<table>
		<tr>
			<th>URI:</th>
			<td>/topics/persistent/public/default/my-topic</td>
		</tr>
		<tr>
			<th>STATUS:</th>
			<td>404</td>
		</tr>
		<tr>
			<th>MESSAGE:</th>
			<td>Not Found</td>
		</tr>
		<tr>
			<th>SERVLET:</th>
			<td>org.glassfish.jersey.servlet.ServletContainer-6b587673</td>
		</tr>
	</table>
	<hr /><a href="<https://eclipse.org/jetty>">Powered by Jetty:// 9.4.51.v20230217</a>
	<hr />

</body>

</html>
y
check issue 13768. proxy does not support client restful endpoint.
o
@David K yes I just figured becaues I tried making the request in the proxy pod it failed but it worked in the broker pod but then again the broker does not allow me to expose it's service directly maybe I should create a new service definition for it or is there a fix in the values yaml file ?
y
You can use service mesh like istio to expose brokers
➕ 2
o
thank you so much @David K I will try it out. I am really grateful for all your help
👍 2
hello @David K I have successfully exposed the service but I get this error most of the time and my message will not be created
Copy code
{
  "reason": "Can't find owner of given topic."
}
d
When you published the messages, had you already authenticated?
k
@ojoxdan have you resolved the issue?
o
@Ken not yet, I figured it could be as a result of running more than one pod, I have three replicas for my broker, if I continously make same request over a period of time - lets say 40 requests, I get a successful message however after sometime the error returns. I have tried reducing the number of pods to 1 and when I do I don't get the error at all @David K I have not enabled authentication yet