Http Integration with Java null body

Hello, i successfully integrated my microservice to receive callbacks from chirpstack for a certain device.
The problem is that i’m always receiving a null body, except for the event params that works fine:

    @ResponseStatus(value = HttpStatus.OK)
    @PostMapping(value = "/callback", consumes = "application/json")
    public ResponseEntity<Object> eventCallback(@RequestParam("event") String event, @RequestBody Object object) {
        JsonNode jsonData = null;
        try {
            jsonData = mapper.readTree(gson.toJson(object));
        } catch (JsonMappingException e) {
        } catch (JsonProcessingException e) {
        mqttPublisher.publishMessage(event, jsonData);
        return ResponseEntity.ok("Ok!");

The Object object appear to be alwasy null before reaching the mapper execution. I’ve tried with different names and Types but it’s always null.

On the chirpstack guy i can see the payload received full of data.

Any advice?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.