I have a CoAP server postcall defined in a @Component class that was overridden from the CoapResource class. The requests are not being logged in Azure App Insights. However, requests to @RestController are being logged properly.
`Command used to run app insights: java -javaagent:applicationinsights-agent-3.4.17.jar -jar .\demo-0.0.1-SNAPSHOT.jar'
import org.eclipse.californium.core.CoapResource;
import org.eclipse.californium.core.server.resources.CoapExchange;
import org.springframework.stereotype.Component;
@Component
public class HelloWorldResource extends CoapResource {
public HelloWorldResource() {
super("hello");
}
@Override
public void handlePOST(CoapExchange exchange) {
String receivedMessage = exchange.getRequestText();
String response = "IntelliJ" + receivedMessage;
exchange.respond(response);
}
}`
I wanted to log telemetry around coap server requests.
This is something to do with the Protocall. In http case we call localhost:8080/hello and in coap case we call via coap://localhost/hello.