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) {
e.printStackTrace();
} catch (JsonProcessingException e) {
e.printStackTrace();
}
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?