ESP32 MQTT onMessage Callback never called

you are right!

when i send "test" to the door/update topic i get the following output:

Attempting to connect to SSID: dehei.local...ok!
MQTT connecting connected!
Requesting Shadow [$aws/things/chicken-door/shadow/name/door/get]: Sending test to $aws/things/chicken-door/shadow/name/door/update: 
Sending test to $aws/things/chicken-door/shadow/name/door/update: 
Received [$aws/things/chicken-door/shadow/name/door/update]: test
Received [$aws/things/chicken-door/shadow/name/door/update/rejected]: {"code":400,"message":"Payload contains invalid json"}
Sending test to $aws/things/chicken-door/shadow/name/door/update: 
Received [$aws/things/chicken-door/shadow/name/door/update]: test
Received [$aws/things/chicken-door/shadow/name/door/update/rejected]: {"code":400,"message":"Payload contains invalid json"}

So the payload is received but not accepted by AWS IOT.. Therefor I get an error message in the /update/rejected topic

I changed to code to send a valid json.. then I get the follwing ouput:

Attempting to connect to SSID: dehei.local...ok!
MQTT connecting connected!
Requesting Shadow [$aws/things/chicken-door/shadow/name/door/get]: {"state":{"reported":{"value":"closed"}}}
Sending {"state":{"reported":{"value":"closed"}}} to $aws/things/chicken-door/shadow/name/door/update: Received [$aws/things/chicken-door/shadow/name/door/get]: 
Received [$aws/things/chicken-door/shadow/name/door/update]: {"state":{"reported":{"value":"closed"}}}
Received [$aws/things/chicken-door/shadow/name/door/update/accepted]: {"state":{"reported":{"value":"closed"}},"metadata":{"reported":{"value":{"timestamp":1638433784}}},"version":139,"timestamp":1638433784}
{"state":{"reported":{"value":"closed"}}}
Sending {"state":{"reported":{"value":"closed"}}} to $aws/things/chicken-door/shadow/name/door/update: Received [$aws/things/chicken-door/shadow/name/door/update]: {"state":{"reported":{"value":"closed"}}}
Received [$aws/things/chicken-door/shadow/name/door/update/accepted]: {"state":{"reported":{"value":"closed"}},"metadata":{"reported":{"value":{"timestamp":1638433789}}},"version":140,"timestamp":1638433789}
{"state":{"reported":{"value":"closed"}}}

This is great. The only thing that is still not working is to get the current state in the setup function.

When testing this in mqtt broker it works. But as we see in the ouptut I never receive a message on any topic after requesting the shadow:

Requesting Shadow [$aws/things/chicken-door/shadow/name/door/get]: {"state":{"reported":{"value":"closed"}}}
Sending [......]

I added a delay between the subscritions and the shadow request but still no luck:

  connectToMqtt();
  delay(2000);
  getShadow();